Summary on 20080717: web page refresh

来源:互联网 发布:增霸卡网络同传教程 编辑:程序博客网 时间:2024/06/05 02:38
These days I'm working on web page refresh, and find that there are lots of ways to refresh page:
1. window.location.reload(true/false)
2. window.location.href = window.location.href(url)
3. window.location.replace(URL)
4. document.execCommand('Refresh');

Why when refresh page, there will be confirmation window to ask for the confirmation:
http://hi.baidu.com/ouanan/blog/item/cdace608828832900b7b8226.html

Note that window.location.href = url won't work well on IE6 and Maxthon.
but window.location.reload() won't have this problem

Difference between reload and replace:
http://www.110xs.com/archiver/?tid-1592/
In short, the difference is that reload(true/false)will get value from server or cache depending on the value of the parameter.
however, for the replace method,IE will use the url to replace the content in cache,so after using this method, can't use back/forward button of IE to navigate between web page.



原创粉丝点击