且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

提交 Ajax 表单后如何将用户重定向到另一个页面

更新时间:2023-01-08 13:37:42

您的成功回调语法不正确.应该是:

Your success callback syntax is incorrect. It should rather be:

$('#theForm').ajaxForm(function() { 
    window.location.href = "/path/to/thankyoupage";
});

另外,注意是window.location.href而不是location.window.href