<a onclick="javascript:window.location.href=window.location.href;">

<a onclick="javascript:window.location.reload();">

测试效果一样。表单没有提交。

<input type="submit" onclick="javascript:window.location.reload();" value="单击" />
<input type="submit" onclick="javascript:window.location.href=window.location.href;" value="单击" />

都提交数据

 

window.location.Reload()应该是刷新.(如果有数据提交的话,会提示是否提交的(是和否选项))
window.location.href=window.location.href; 是定向url提交数据

最好不要用location.reload(),而用location=location比较好,还有在模式窗口(showModalDialog和showModelessDialog)前者不能用。

 

reload参数有true和false,比较有意思?

相关文章:

  • 2022-12-23
  • 2021-05-16
  • 2021-10-03
  • 2021-11-10
猜你喜欢
  • 2022-12-23
  • 2021-09-30
  • 2021-07-01
  • 2022-12-23
相关资源
相似解决方案