Javascript返回上一頁--Java學習與輔導
1. Javascript 返回上一頁 history.go(-1), 返回兩個頁面: history.go(-2);2. history.back().
3. window.history.forward()返回下一頁
4. window.history.go(返回第幾頁,也可以使用訪問過的URL)
例:
<a href="javascript:history.go(-1);">向上一頁</a>
response.Write("<script language=javascript>")
response.Write("if(!confirm('完成任務?')){history.back();}")
response.Write("</script>")
response.Write("<script language=javascript>history.go(-1);</script>")
<a href="javascript:history.go(-1);">向上一頁</a>
頁面跳轉: onclick="window.location.href='list.aspx'"
P.S.
小技巧(JS引用JS):
<script type=text/javascript>
<!--
if (typeof SWFObject == "undefined") {
document.write('<scr' + 'ipt type="text/javascript" src="/scripts/swfobject-1.5.js"></scr' + 'ipt>');}
//-->
</script>
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 不錯,感謝版主 拿分走人呵呵,樓下繼續! 我也來頂一下..
这是什么?
頁:
[1]