J Report this existing code.

I need help using jConfirm with this existing code (php and jquery and jAlert).

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

If I just changed the confirmation to jConfirm, this is not enough to make it work ...

thanks for the help

Lena

+4
source share
1 answer
 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 advisable to remove the variable "$ _sidId" from "if", regardless of the answer, it should clear the variable.

+6
source

All Articles