一.直接跳出加入收藏对话框:
1.在网页主体标记<body >中加入调用onunload="bookmark()" ,即改成<body onunload="bookmark()">。
2.在HTML的<HEAD>和</HEAD>之间加入如下代码:
<script language="javascript"> function bookmark(){ window.external.AddFavorite('http://www.7adesign.com/', '程英设计') } </script>
二.询问后再跳出加入收藏对话框:
<SCRIPT LANGUAGE="JavaScript"> function Addme(){ if (window.confirm(“能加入收藏,继续关心小站吗!")){ if (document.all) window.external.AddFavorite('http://www.7adesign.com/', '7A设计');} window.config.timer=window.setTimeout('sbprint()',window.config.delay); } </SCRIPT> <body onbeforeunload=Addme()>
三.点击后加入收藏的代码:
<a href="javascript:window.external.AddFavorite('http://www.diandiba.com/', '点滴吧')" target="_self" >加入收藏</a>