gpt4 book ai didi

php - jConfirm 这个现有的代码

转载 作者:可可西里 更新时间:2023-10-31 22:49:53 25 4
gpt4 key购买 nike

我需要帮助才能将 jConfirm 与现有代码(php & Jquery & jAlert)结合使用。

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

}

如果我只是将 confirm 更改为 jConfirm 这还不足以使其工作...

谢谢你的帮助

莉娜

最佳答案

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

编辑评论:

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;
});
}

当我更好地看到脚本时,希望从“if”中删除变量“$_sidId”,无论响应如何,它都必须清理变量。

关于php - jConfirm 这个现有的代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1701772/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com