javascript經典效果(二)

quguiliang 14年前發布 | 937 次閱讀

腳本4:顯示最后修改時間的腳本


  1. <script>document.write(document.lastModified)</script>
復制代碼

腳本5:設為首頁,加為收藏,加入頻道,啟動outlook發信


  1. <a style="cursor:hand" 
  2. onclick="this.style.behavior="url(#default#homepage)";
  3. this.setHomePage(http://10.13.31.90/~kayvin/);">">設為首頁</a>
  4. <a style="cursor:hand"
  5. onclick="window.external.AddFavorite(location.href,document.title);">加入收藏</a>
  6. <a href=
  7. <a href="mailto:kayvin@sohu.com">與我聯系</a>
復制代碼

腳本6:狀態欄動態顯示現在時間


  1. <script>
  2. function see(){
  3. window.setTimeout("see()",1000);
  4. today = new Date();
  5. self.status = today.toString();
  6. }
  7. </script>
  8. <body onload=see()>
復制代碼

腳本7:關閉窗口的腳本


  1. <a href=javascript:close()>[關閉窗口]</a>
復制代碼

腳本8:按下F12鍵,直接返回首頁


  1. <script>function look(){
  2. if(event.keyCode==123){document.location.href=http://10.13.31.90/~kayvin/}
  3. }
  4. if(document.onkeydown==null)
  5. {document.onkeydown=look}
  6. </script>
復制代碼

腳本9:后退,刷新,前進


  1. <input type=button value=后退 onclick=history.go(-1)>
  2. <input type=button value=刷新 onclick=history.go(-0)>
  3. <input type=button value=前進 onclick=history.go(+1)>
復制代碼


腳本10:設定時間彈出窗口,4000=4秒,當然你可以自定義


  1. <script>function l()
  2. {
  3. window.open(" 10.13.31.90/~kayvin/ ","name","width=500,height=150,border=0")
  4. }
  5. setTimeout("l()",4000)
  6. </script>
復制代碼

 本文由用戶 quguiliang 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!