HTML设为首页/加入收藏代码

(特别注意:要把’这个符号换成无任何输入法状态中输入的’这个符号,否则程序无法运行)

1.文字型:

<a onclick="this.style.behavior=’url(#default#homepage)’;this.setHomePage(’http://www.apple-wallpaper.com’);" href="http://www.apple-wallpaper.com">设为首页</a>

2.按钮型:

<input TYPE="button" VALUE=" 设为首页 " onclick="this.style.behavior=’url(#default#homepage)’;this.setHomePage(’http://www.apple-wallpaper.com’);" href="http://www.apple-wallpaper.comt">

3.离开时自动提示设为首页:

<body onunload="BASEBody.style.behavior=’url(#default#homepage)’;if(!(BASEBody.isHomePage(’http://www.1.com’)))BASEBody.setHomePage(’http://www.apple-wallpaper.comt’);">

4.打开网页就提示是否设为主页:

<script language="javascript">

function myhomepage(){

this.homepage.style.behavior=’url(#default#homepage)’;this.homepage.sethomepage(’http://www.dafacai.net’);

}

</script>

<p align="center"><a href="http://www.apple-wallpaper.comt" name="homepage"

onclick="myhomepage();"></a>

1.图片链接

<a style="cursor:hand" onclick="this.style.behavior=‘url(#default#homepage)‘;

this.setHomePage(‘http://www.apple-wallpaper.com‘);">

<img width=16 height=16 border=0 src="images/Logo.gif">

<u> 设为首页</u></a>

2.文字型:

<a onclick="this.style.behavior=‘url(#default#homepage)‘;

this.setHomePage(‘http://www.apple-wallpaper.com‘);" href="#">设为首页</a>

3.按钮型:

<input TYPE="button" VALUE=" 设为首页 " onclick="this.style.behavior=‘url(#default#homepage)‘;

this.setHomePage(‘http://www.apple-wallpaper.com‘);" href="#">

4.离开时自动提示设为首页

<body onunload="BASEBody.style.behavior=‘url(#default#homepage)‘;

if(!(BASEBody.isHomePage(‘http://www.apple-wallpaper.com‘)))BASEBody.setHomePage(‘http://www.apple-wallpaper.com/‘);">

5.鼠标指向时提示设为首页

<A href="http://www.apple-wallpaper.com/" onmouseover="this.style.behavior=‘url(#default#homepage)‘;

this.setHomePage(‘http://www.apple-wallpaper.com‘);" target="_blank">设为首页</A>

-------------------------------------------------------------------------------

加入收藏代码

1.

<a href="#" onclick="javascript:window.external.AddFavorite(‘http://www.apple-wallpaper.com‘,‘苹果壁纸资源‘)" title="收藏本站到你的收藏夹"><font size="-1" color="#FFE09E">收藏本站</font></a>

2.

<a href="javascript:void(0);" onClick="window.external.AddFavorite(document.location.href,document.title)">加入收藏</a>

加入频道

<a href="typhoon.cdf")>加入频道</a>

邮件链接

<a href="mailto:[email protected]">与我联系</a>

再将下面代码加入<body>内:

onload="myhomepage();"

即:<body onload="myhomepage();">

时间: 2024-08-06 19:45:32

HTML设为首页/加入收藏代码的相关文章

设为首页/加入收藏代码(仅限IE)

设为首页 <a onclick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://'+document.location.host);" href="javascript:">设为首页</a> 加入收藏 <a href="javascript:" onClick="window.external.AddFavorit

设为首页/加入收藏 代码

// 设置为主页function SetHome(obj,url){   try{        obj.style.behavior='url(#default#homepage)';        obj.setHomePage(url);    }catch(e){        if(window.netscape){           try{               netscape.security.PrivilegeManager.enablePrivilege("Univ

设为首页、收藏的JS代码

HTML代码中: <a  href="#"    onclick="AddFavorite(window.location,document.title)"  >加入收藏</a> <a  href="#" onclick="SetHome(this,window.location)" >设为首页</a> JS代码: // JavaScript Document // 加入收藏 &

刷新按钮,设为首页,等html代码

刷新按钮,设为首页,等html代码 1刷新按钮[color=#ffff00]接钮[/color]<button >刷新</button>[color=#ffff00]文字[/color]<a href="#"  class="css3">刷新</a>             [color=#ffff00]图片[/color]<img src=1.gif height=24 width=68 alt=open st

javascript 设为首页 | 加入收藏夹 JS代码

我们介绍一个可兼容所有浏览器的加入收藏代码代码,大概原理是这样的我们根据获取用户navigator.userAgent.toLowerCase()信息来判断浏览器,根据浏览器是否支持加入收藏js命令,如果可以自动收藏否则就提示ctrl+D手动收藏了. 1 function addFavorite2() { 2 var url = window.location; 3 var title = document.title; 4 var ua = navigator.userAgent.toLowe

ASP.NET中怎样将页面设为首页,加入收藏

1.文字js脚本事件:<span onClick="var strHref=window.location.href;this.style.behavior=’url(#default#homepage)’;this.setHomePage(‘http://www.unvs.cn’);" style="CURSOR: hand"> 2.文字链接事件:<a href="#" onClick="window.externa

Javascript 设为首页 + 加入收藏(全兼容)

//加入收藏夹 function AddFvtgc() { var title = document.title; var url = document.location.href; try { window.external.AddFavorite(url, title); } catch (e) { alert("请按下 Ctrl + D 键将本站加入收藏."); } } //设为首页 function AddHomegc() { var url = document.locati

设为首页收藏本站js代码(引自ecshop模板堂(ecmoban.com)

http://help.ecmoban.com/article-1596.html 设为首页 和 收藏本站js代码 兼容IE,chrome,ff,360等 将以下代码放到首页 或者新建js文件 <script type="text/javascript"> //设为首页 www.ecmoban.com function SetHome(obj,url){ try{ obj.style.behavior='url(#default#homepage)'; obj.setHom

c# 设为首页和加入收藏代码

设为首页 把如下代码加入<body>区域中:<span onclick="var strHref=window.location.href;this.style.behavior='url(#default#homepage)';this.setHomePage('http://blog.sina.com.cn/majinchi1987');" style="CURSOR: hand">设为首页</span> 加入收藏代码 把如下