Home >  > 关闭网页弹出收藏夹代码

关闭网页弹出收藏夹代码

0

单页面退出 弹出收藏本站的代码 ,这个代码只能用于单页面 ,多个页面的话 当用户点别的页面的时候还会反复弹出。
[sourcecode language="html"]
<HTML>
<body onUnload="javascript:chouchang()">
</BODY>
</HTML>
<SCRIPT LANGUAGE="JavaScript">
<!--
function chouchang()
{
window.external.addFavorite('http://www.bestchao.com','加入收藏夹下次更方便');

}
//-->
</SCRIPT>
[/sourcecode]
24小时一天只弹出一次 加入收藏的代码 记录cookies

下面的一天只弹一次
[sourcecode language="html"]
<HTML>
<body onUnload="javascript:helpor_net()">
</BODY>
</HTML>
<SCRIPT LANGUAGE="JavaScript">
<!--
function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1)
end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function helpor_net(){
if (get_cookie('popped')==''){
//openpopup();
window.external.addFavorite('http://www.s5dofus.com','这里写中文说明'); //弹出加入收藏
document.cookie="popped=yes"
}
}

//-->
</SCRIPT>
[/sourcecode]

相关推荐

本文暂无标签

发表评论

You must be logged in to post a comment.