确定点击按钮上的函数调用

function call on ok click button

以下是我的代码。模态弹出窗口出现。当我单击 ok 时,用户应该重定向到一个操作方法。我怎样才能做到这一点。请帮助。

<script type="text/javascript">
        debugger;
        $(document).ready(function () {

            debugger;
            $("#dialog").dialog({
                title: "Alert!",
                buttons: {
                    Ok: function () {
                        $(this).dialog('ok');
                    }
                }
            });

        });
    </script>

你可以这样使用window.location.href

$("#dialog").dialog({
    title: "Alert!",
    buttons: {
        Ok: function() {
            window.location.href = " put your url "
        }
    }
});

您可以在确定按钮响应函数中使用 window.location.hrefwindow.location.replace

$("#dialog").dialog({
    title: "Alert!",
    buttons: {
        Ok: function() {
           window.location.replace("http://whosebug.com");
           return false;
        }
    }
});