且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Jquery,从点击获取url并传递到对话框中的确认按钮

更新时间:2022-12-02 18:33:12

您可以获得href属性: $('#deletec-confirm ').attr('href');

You can get the href attribute with: $('#deletec-confirm').attr('href');

您的代码现在如下:

$("#deletec-box").dialog({
    autoOpen: false,
    resizable: false,
    height:230,
    modal: true,
    buttons: {
        "Confirm": function() {
            window.location = $('#deletec-confirm').attr('href');
            $(this).dialog("close");
        },
        Cancel: function() {
            $(this).dialog("close");
        }
    }
});

$("#deletec-confirm").click(function() {
    $("#deletec-box").dialog("open");
    return false;
});