JS捕獲頁面刷新,JS刷新父頁面

JS刷新父頁面

十一種刷新按鈕的方法。很不錯的,經常上網要找。哈哈。這下放這裏了。  

<input type=button value=刷新 οnclick="history.go(0)">
<input type=button value=刷新 οnclick="location.reload()">
<input type=button value=刷新 οnclick="location=location">
<input type=button value=刷新 οnclick="location.assign(location)">
<input type=button value=刷新 οnclick="document.execCommand('Refresh')">
<input type=button value=刷新 οnclick="window.navigate(location)">
<input type=button value=刷新 οnclick="location.replace(location)">
<input type=button value=刷新 οnclick="window.open('自身的文件','_self')">
<input type=button value=刷新 onClick=document.all.WebBrowser.ExecWB(22,1)> 
<OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT>
<form action="自身的文件">
<input type=submit value=刷新>
</form>
<a id=a1 href="自身的文件"></a>

<input type=button value=刷新 οnclick="a1.click()">

JS捕獲刷新

window.onbeforeunload = function()  
{      
       var n = window.event.screenX - window.screenLeft;      
       var b = n > document.documentElement.scrollWidth-20;      
       if(b && window.event.clientY < 0 || window.event.altKey)      
       {      
              alert("是關閉而非刷新");      
              window.event.returnValue = "";   
       }else  
       {      
              alert("是刷新而非關閉");       
       }      
}  

發佈了15 篇原創文章 · 獲贊 6 · 訪問量 6萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章