我有一个表单要提交,一旦提交,我需要显示包含表单详细信息的确认页面。我使用下面的代码来执行此操作,但是,它被重定向到空白页。
代码:
以前提交需要jQuery Post的行动
$('#btnSubmit').click(function () {
confirmationPage();
document.formPsmq.action = "/reports/htm/submit.do";
document.formPsmq.submit();
});
如何使用jQuery post方法在没有重定向的情况下保持在同一页面上?
感谢您的帮助。
答案 0 :(得分:2)
My apologies. Now I am understood "Why this question was downvoted". I didn't perform a basic search to find the answer.
This post helped me.
Here is the code
$('#btnSubmit').click(function () {
confirmationPage();
//document.formPsmq.action = "/reports/htm/submit.do";
//document.formPsmq.submit();
var data = $('#formPsmq').serialize();
$.post('/reports/htm/submit.do', data);
});