javascript - 自定义确认弹出窗口无法正常工作

标签 javascript jquery html css popup

我正在使用插件来自定义确认弹出窗口。我能够自定义确认弹出窗口,但问题是当我单击删除图标时,自定义确认弹出窗口打开,在给出“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/

相关文章:

php - 在 PhP 中搜索 MySQL 数据库

jquery - 使用 tablesorter 设置列的默认排序

javascript - 访问 ng-repeat 范围

javascript - Date.js parseExact() 在作为数组传入时不解析 4 位数年份

javascript - 同一页面上的多个 Jquery 脚本冲突

jQuery datepicker 禁用星期日和特定日期数组

php - 如何在 PHP 中提取 anchor 标记之间的文本?

javascript - 从 jQuery 选择器 .html() 中删除 Ember.js 脚本标签

javascript - Rails 4 应用程序一页上的多个 Stripe 支付按钮

jquery - 将数据属性与 jquery 验证一起使用