Ajax請求成功後頁面跳轉

通過location.href,進行頁面的跳轉

<input id="title" type="text" placeholder="請輸入標題">
<input id="input" type="button" value="發佈">
        $("#input").click(function () {
            $.post({
                url: "/editormd",
                data: {
                    title: $("#title").val(),
                },
                success: function () {
                    location.href="/";
                }
            });
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章