可以建立一个ads.js,下面就是这个JS文件的代码.把这个文件调用要你需要弹出广告的网页即可,下面代码实现的是每隔24小时弹出一次窗口的代码:
以下是ads.js片段:
function openpopup(){ document.writeln("; <SCRIPT language=javascript>"); document.writeln("window.open('http://www.duzi.cn')"); document.writeln("</script>"); }
function get_cookie(Name) { var search = Name + "=" var returnvalue = ""; if (documents.cookie.length > 0) { offset = documents.cookie.indexOf(search) if (offset != -1) { offset += search.length end = documents.cookie.indexOf(";", offset); if (end == -1) end = documents.cookie.length; returnvalue=unescape(documents.cookie.substring(offset, end)) } } return returnvalue; }
function webjx_com(){ if (get_cookie('popped')==''){ openpopup() documents.cookie="popped=yes" } } webjx_com()
|