我正在使用的表单是嵌入式js表单,因此我无法直接访问代码。
我正在进行一次贸易展,我希望表单页面在表单提交后5秒刷新。
我正在使用此代码,但没有得到刷新。我错过了什么?
<script type="text/javascript">
// Reload page 5 seconds after form submission
$("form").onsubmit = setTimeout(function () {
window.location = "/tradeshow/";
}, 5000);
</script>
谢谢!
你必须使用location.reload()
function。
试试这个:
<script type="text/javascript">
// Reload page 5 seconds after form submission
$("form").onsubmit = setTimeout(function () {
location.reload(true); //MODIFICATION
}, 5000);
</script>
您只能使用元标记更新用户页面而不提交表单:
meta http-equiv="Refresh" content="0.5"