DIV CSS 佈局教程網

您现在的位置: DIV+CSS佈局教程網 >> 網頁腳本 >  >> CSS入門知識 >> CSS詳解
HTML 重新整理寫法彙整:五種可用,三種待考
編輯:CSS詳解     

把網路上流傳的刷新寫法整理如下,前半段是實測可用的版本。

可直接使用的寫法

<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="window.navigate(location)">
<input type=button value=刷新 onclick="location.replace(location)">

用法待確認的寫法

以下三種流傳於各處,但實際該怎麼觸發、在哪些環境下有效,一直沒有明確說法,先原樣保留:

<input type=button value=刷新 onclick="document.execCommand('Refresh')">
<input type=button value=刷新 onclick="window.open('自身的檔名','_self')">
<input type=button value=刷新 onClick=document.all.WebBrowser.ExecWB(22,1)>

其中 ExecWB 與 document.all 都帶有明顯的 IE 專屬痕跡,跨瀏覽器時不建議採用;若只求穩定,location.reload() 仍是最保险的選擇。

XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved