入收藏夾,設爲首頁代碼
把以下代碼加入<Body>相應位置:
- <a target=_top href="javascript:window.external.addFavorite('http://free.ylwy.net','狐狸貓網絡');">加入收藏</a>
- <a href='#' onClick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://free.ylwy.net');">設爲首頁</a>
<a target=_top href="javascript:window.external.addFavorite('http://free.ylwy.net','狐狸貓網絡');">加入收藏</a>
<a href='#' onClick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://free.ylwy.net');">設爲首頁</a>
鼠標指向時提示設爲首頁
將下列代碼插入<body>區中:
- <A href=http://free.ylwy.net onmouseover="this.style.behavior='url(#default#homepage)';this.setHomePage('http://free.ylwy.net');" target="_blank">設爲首頁</A>
<A href=http://free.ylwy.net οnmοuseοver="this.style.behavior='url(#default#homepage)';this.setHomePage('http://free.ylwy.net');" target="_blank">設爲首頁</A>
打開頁面時自動彈出窗口詢問是否設爲首頁
將以下代碼放在<head></head>之間:
- <script language="javascript">
- function myhomepage(){
- this.homepage.style.behavior='url(#default#homepage)';this.homepage.sethomepage('http://free.ylwy.net');
- }
- </script>
- <p align="center"><a href=http://free.ylwy.net name="homepage"
- onclick="myhomepage();"></a>
<script language="javascript">
function myhomepage(){
this.homepage.style.behavior='url(#default#homepage)';this.homepage.sethomepage('http://free.ylwy.net');
}
</script>
<p align="center"><a href=http://free.ylwy.net name="homepage"
οnclick="myhomepage();"></a>
再將下面代碼加入<body>內:
- onload="myhomepage();"
οnlοad="myhomepage();"
即:
- <body onload="myhomepage();">
<body οnlοad="myhomepage();">
離開時自動提示設爲首頁
替換<body>標籤爲:
- <body onunload="BASEBody.style.behavior='url(#default#homepage)';if(!(BASEBody.isHomePage('http://free.ylwy.net')))BASEBody.setHomePage('http://free.ylwy.net/');">
<body οnunlοad="BASEBody.style.behavior='url(#default#homepage)';if(!(BASEBody.isHomePage('http://free.ylwy.net')))BASEBody.setHomePage('http://free.ylwy.net/');">
- <a onClick="this.style.behavior=''url(#default#homepage)'';this.setHomePage(''http://www.www.com'')" href="#">設爲首頁</a>