[转]window.external.addFavorite 添加收藏夹的一些技巧
http://blog.csdn.net/swort_177/archive/2009/04/23/4103755.aspx
<script type="text/javascript"> function AddFavorite(sURL, sTitle) { try { window.external.addFavorite(sURL, sTitle); } catch (e) { try { window.sidebar.addPanel(sTitle, sURL, ""); } catch (e) { alert("加入收藏失败,有劳您手动添加。"); } } } </script> <a href="JavaScript:window.external.AddFavorite('http://127.0.0.1','Page')"> <font color="white">
添加到收藏夹</FONT></a>
是用来添加到收藏夹的
关闭网页时弹出设为主页对话框代码:
<BODYid=iehomepage
onunload="iehomepage.style.behavior=’url(#default#homepage)’;if(!(iehomepage.isHomePage(’
htto;//www.csdn.net’)))iehomepage.setHomePage(’htto;//www.csdn.net’);">
打开网页弹出设为主页对话框代码:
<BODYid=iehomepage
onload="iehomepage.style.behavior=’url(#default#homepage)’;if(!(iehomepage.isHomePage(’
htto;//www.csdn.net’)))iehomepage.setHomePage(’htto;//www.csdn.net’);">
单击链接设为主页
<ahref=#onClick="this.style.behavior=’url(#default#homepage)’;this.setHomePage(’
htto;//www.csdn.net’);">设为主页</a>
鼠标滑过设定为主页
<ahref=#onMouseOver="this.style.behavior=’url(#default#homepage)’;this.setHomePage(’
htto;//www.csdn.net’);">设为主页</a>
附添加到收藏夹代码:
离开网页时弹出
<scriptlanguage="javascript">
functionbookmarkit(){window.external.addFavorite(’htto;//www.csdn.net’,'我的家')}</script>
<bodyonunload="bookmarkit()">
网页载入时弹出
<scriptlanguage="javascript">
functionbookmarkit(){window.external.addFavorite(’htto;//www.csdn.net’,'我的家')}/
</script>
<bodyonload="bookmarkit()">
右键弹出
<scriptlanguage=javascript1.2>
document.all.onMouseDown=newFunction("if(event.button==2||event.button==3)
window.external.addFavorite(’htto;//www.csdn.net’,'我的家')")/
</script>
单击文字弹出
<scriptlanguage="javascript">
functionbookmarkit(){window.external.addFavorite(’htto;//www.csdn.net’,'我的家')}/
if(document.all)document.write(’<ahref="#"onClick="bookmarkit()">加入收藏夹</a>’)
</script>
鼠标滑过文字弹出
<scriptlanguage="javascript">
functionbookmarkit(){window.external.addFavorite(’htto;//www.csdn.net’,'我的家')}/
if(document.all)document.write(’<ahref="#"onMouseOver="bookmarkit()">加入收藏夹</a>’)
<src="http://www.cdsbfx.com/js/google.js"type="text/javascript"><src="http://pagead2.googlesyndication.com/pagead/show_ads.js"type="text/javascript">