且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用JavaScript重新加载页面的首选方法?

更新时间:2023-10-31 11:55:34

取决于你想做什么。第四种和第六种方法不会重新加载任何表单数据,它们实质上是单独访问页面。某些版本的Firefox也存在第三种方法的问题。除此之外,我会选择第五个作为个人偏好。这似乎是最清楚的。

Depends on what you want to do. The fourth and sixth methods there won't reload any form data, they essentially make a separate visit to the page. Some versions of Firefox also have issues with the third method. Other than that, I'd go with the fifth as a personal preference. It seems the clearest.