我正在使用插件来自定义确认弹出窗口。我能够自定义确认弹出窗口,但问题是当我单击删除图标时,自定义确认弹出窗口打开,在给出“ok
”或“cancel
”。
我使用的插件来自这个 url -> http://labs.abeautifulsite.net/archived/jquery-alerts/demo/
我的代码看起来像,
function deleteFeed(url, feed_id) {
if(jConfirm("Do you want to delete this feed?")) {
$.post(url+'feeds/delete/',
{
feedid: feed_id
}
, function(response) {
window.location.replace(url+'feeds/index');
});
}
}
需要帮助。
最佳答案
您是否注意到他们的演示中功能的使用有所不同?试试这个:
jConfirm("Do you want to delete this feed?", 'Confirmation Dialog', function(r) {
if (r) {
$.post(url+'feeds/delete/',
{
feedid: feed_id
}
, function(response) {
window.location.replace(url+'feeds/index');
});
}
});
关于javascript - 自定义确认弹出窗口无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20635729/