开发者

jConfirm with this existing code

开发者 https://www.devze.com 2022-12-11 02:36 出处:网络
I need help to use jConfirm with this existing code (php & Jquery & jAlert). function logout()

I need help to use jConfirm with this existing code (php & Jquery & jAlert).

function logout()
{
  if (confirm("Do you really want to logout?"))
    window.location.href = "logout.php";

}

If I just change confirm to jC开发者_开发问答onfirm this not enough to make it work...

Thanks for your help

Lena


function logout()
{
  jConfirm('Do you really want to logout?', 'Logout', function(r) {
    if (r)
       window.location.href = "logout.php";
  });
}

EDIT for comments:

function sid(id){
  $_sidId = id;
  jConfirm("Delete System ID for " + id + "?", 'Delete Sid', function(r) {
    if (r){
       window.location.href = "del_sid.php?id=" + $_sidId;
    }
    $_sidId = null;
  });
}

When I saw the script better, it would be desirable to remove the variable "$_sidId" from "if", no matter the response, it would have to clean up the variable.

0

精彩评论

暂无评论...
验证码 换一张
取 消