以下是我的代码。出现模态弹出窗口。当我点击ok
时,用户应该重定向到动作方法。我怎样才能做到这一点。请帮忙。
<script type="text/javascript">
debugger;
$(document).ready(function () {
debugger;
$("#dialog").dialog({
title: "Alert!",
buttons: {
Ok: function () {
$(this).dialog('ok');
}
}
});
});
</script>
答案 0 :(得分:1)
您可以像这样使用window.location.href
$("#dialog").dialog({
title: "Alert!",
buttons: {
Ok: function() {
window.location.href = " put your url "
}
}
});
答案 1 :(得分:0)
您可以在ok按钮响应功能中使用window.location.href
或window.location.replace
。
$("#dialog").dialog({
title: "Alert!",
buttons: {
Ok: function() {
window.location.replace("http://stackoverflow.com");
return false;
}
}
});