點擊按鈕或鏈接不跳轉(zhuǎn)只刷新頁面的腳本整理
更新時間:2013年10月22日 15:26:12 作者:
點擊按鈕或鏈接時不跳轉(zhuǎn)只刷新頁面,在某些情況下還是比較實用的,下面整理些不錯的示例,感興趣的朋友可以參考下
復(fù)制代碼 代碼如下:
<input type=button value=刷新 onclick="history.go(0)">
<input type=button value=刷新 onclick="location.reload()">
<input type=button value=刷新 onclick="location=location">
<input type=button value=刷新 onclick="location.assign(location)">
<input type=button value=刷新 onclick="document.execCommand('Refresh')">
<input type=button value=刷新 onclick="window.navigate(location)">
<input type=button value=刷新 onclick="location.replace(location)">
<input type=button value=刷新 onclick="window.open('自身的文件','_self')">
<input type=button value=刷新 onClick=document.all.WebBrowser.ExecWB(22,1)>
<a href="javascript:void(0)" onclick="history.go(0)"></a>
<a href="javascript:void(0)" onclick="location=location"></a>
相關(guān)文章
對JavaScript的eval()中使用函數(shù)的進一步討論
《JavaScript語言精髓與編程實踐》的讀者I22141提出了一問題:為什么下面這段代碼在JScript 和SpiderMonkey中表現(xiàn)不一樣:2008-07-07JS.elementGetStyle(element, style)應(yīng)用示例
獲取Dom元素的Style數(shù)組中的指定Style元素,下面有個不錯的示例,感興趣的朋友可以參考下,希望對大家有所幫助2013-09-09javascript下利用arguments實現(xiàn)string.format函數(shù)
sitepoint上看到Andrew Tetlaw在08年寫的文章arguments: A JavaScript Oddity,閱讀之后,除了對arguments溫故知新一遍以外,印象最深刻的還是Andrew的第一個函數(shù)實現(xiàn)的string.format功能。2010-08-08各種常用瀏覽器getBoundingClientRect的解析
getBoundingClientRect2009-05-05