开发者

Jquery-ui, redirect to some page after you click on close button

开发者 https://www.devze.com 2023-01-28 01:55 出处:网络
how do i redirect after you click the close button? $(document).ready(function() { var $dialog = $(\'<div></div>\')

how do i redirect after you click the close button?

$(document).ready(function() {
    var $dialog = $('<div></div>')
        .html('This dialog will show every time!')
        .dialog({
            autoOpen: false,
            title: 'Basic Dialog'
        });

    $('#opener').click(function() {
        $dialog.开发者_JAVA百科dialog('open');
        // prevent the default action, e.g., following a link
        return false;
    });
});


use

location.href="url";

you can get the bindevent like this

// give your popupid below

$('div#popupid').bind('dialogclose', function(event) {
     alert('closed');
     location.href="new url";
 });


You could define a callback for the close event in the following way as well:

$(document).ready(function() {
    var $dialog = $('<div></div>')
        .html('This dialog will show every time!')
        .dialog({
            autoOpen: false,
            title: 'Basic Dialog',
            close: function(ui, event) {
               $(this).dialog('close');
               // redirect over here.
            }
        });
});
0

精彩评论

暂无评论...
验证码 换一张
取 消