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="/";
                }
            });
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章