欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Ajax请求成功后页面跳转

程序员文章站 2024-01-24 09:04:10
...

通过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="/";
                }
            });
相关标签: JavaWeb