如何将对话框按钮发送到链接?

时间:2015-06-17 22:47:06

标签: javascript jquery jquery-ui

我只想按钮,而不是关闭对话框,链接到另一个页面(或两者都很好)

buttons: [
    {
        text: "Install",
        tabIndex: -1,
        width: "340",
        click: function() {
            $( this ).dialog( "close" );
        }
    }
]

2 个答案:

答案 0 :(得分:0)

$( document ).get(0).href = "http://www.google.com";

变为

slideUp

答案 1 :(得分:0)

而不是

$( this ).dialog( "close" );

使用

// similar behavior as an HTTP redirect
window.location.replace("http://stackoverflow.com");

// similar behavior as clicking on a link
window.location.href = "http://stackoverflow.com";