目前我有一个表单,用户输入信息后,通过jQuery ajax函数处理,然后设置为return false;
,这样用户提交表单后页面不会重新加载。
虽然我需要重新加载页面,但是如果我删除return false;
,它会在显示成功消息之前刷新页面(此消息显示在用户提交数据后)。
$.ajax({
type: "POST",
url: "scripts/process.php",
data: dataString,
success: function() {
$("#st_message").html("<p> Your article was successfully added!</p>");
//I need to reload page after the above message is shown
}
});
return false;
如何在显示消息<p> Your article was successfully added!</p>
后,延迟2-3秒钟重新加载页面,以便用户可以实际阅读该消息。