How to redirect user to another page after Ajax form submission

前端 未结 7 613
既然无缘
既然无缘 2020-12-11 03:54

I\'m having problems redirecting the user to a thank you page after a successful form completion. What happens is that after the form submits, it goes to a blank page (https

7条回答
  •  攒了一身酷
    2020-12-11 04:38

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

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

    Also, note that it is window.location.href and not location.window.href

提交回复
热议问题