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

Javascript 如何使对话框按钮发送到链接?,javascript,jquery,jquery-ui,Javascript,Jquery,Jquery Ui,我只希望按钮链接到另一个页面,而不是关闭对话框(或者两者都可以) 变成 $( document ).get(0).href = "http://www.google.com"; 而不是 $( this ).dialog( "close" ); 使用 “链接到另一页”是指打开另一页吗?你的意思是显示链接吗? $( document ).get(0).href = "http://www.google.com"; $( this ).dialog( "close" ); // similar

我只希望按钮链接到另一个页面,而不是关闭对话框(或者两者都可以)

变成

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

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

“链接到另一页”是指打开另一页吗?你的意思是显示链接吗?
$( document ).get(0).href = "http://www.google.com";
$( 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";