要求:返回上一頁並刷新
簡單記錄幾個夠用就行;
html<a href="javascript:history.go(-1)">返回上一頁</a>
<a href="javascript:location.reload()">重載頁面,本地刷新</a>
<a href="javascript:history.go(-1);location.reload()">返回上一頁重載頁面,本地刷新</a>
js
history.go(-1);
location.reload();
注意:history.go(-1);返回常用這個的話,該方法不能實現刷新功能。。
在微信開發的實戰中。history.go(-1);返回上一頁帶有刷新效果了(不知為何)。但是ios並沒有刷新。
!!!!@@@這些玩意不想知道的太多,腦子費勁哈哈~~~
Javascript刷新頁面的幾種方法:
1 history.go(0)
2 location.reload()
3 location=location
4 location.assign(location)
5 document.execCommand('Refresh')
6 window.navigate(location)
7 location.replace(location)
8 document.URL=location.href