html-javascript前端頁面重新整理重載的方法匯總

來源:互聯網
上載者:User

標籤:set   cat   ecc   .com   ack   重新整理   class   頁面   man   

html-javascript前端頁面重新整理重載的方法匯總2014年8月31日 12227次瀏覽

記得我在興安得力實習要轉正的時候,我領導象徵性的給我出了一套測試題目,裡面就有js閉包和頁面重新整理等題目。今天把很久之前的測試題目之一,js頁面重新整理的方法以及頁面自動重新整理跳轉和返回上一頁和下一頁等方法總結一下,僅供大家參考!

一、javascript頁面重新整理重載的方法:

<a href="javascript:location.reload();">點擊重新載入頁面</a><a href="javascript:history.go(0);">點擊重新載入頁面</a><a href="javascript:location=location;">點擊重新載入頁面</a><a href="javascript:location=location.href;">點擊重新載入頁面</a><a href="javascript:location.replace(location);">點擊重新載入頁面</a><a href="javascript:location.replace(location.href);">點擊重新載入頁面</a><a href="javascript:location.assign(location);">點擊重新載入頁面</a><a href="javascript:location.assign(location.href);">點擊重新載入頁面</a><!--// 以下只支援ie --><a href="javascript:document.URL=location.href;">點擊重新載入頁面</a><a href="javascript:navigate(location);">點擊重新載入頁面</a><a href="javascript:document.execCommand(‘Refresh‘);">點擊重新載入頁面</a><!--// 以上只支援ie -->

二、html連結重新載入方法

<!--// 以下不支援ie --><a href="">點擊重新載入頁面</a><!--// 以上不支援ie --><a href="頁面本身">點擊重新載入頁面</a>

三、自動重新整理頁面的方法

<meta http-equiv="refresh" content="20">  //代碼放在head中,每隔20秒鐘重新整理一次<meta http-equiv="refresh" content="20;url=http://www.haorooms.com">  //20秒之後頁面跳轉到haorooms中,通常運用到404頁面//js自動重新整理function myrefresh(){       window.location.reload();}setTimeout(‘myrefresh()‘,1000); //指定1秒重新整理一次

三、返回上一頁和下一頁的方法

history.go(-1)//返回上一頁(括弧中寫-2代表返回上兩頁)history.back()//返回上一頁window.history.forward()  //返回下一頁

html-javascript前端頁面重新整理重載的方法匯總

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.