没办法,做站的都要用的这个东西,在落伍叫人帮找的。感谢落伍id 自选风格 兄弟
function setcookie(name, value, expire) {
window.document.cookie = name + “=” + escape(value) + ((expire == null) ? “” : (”; expires=” + expire.togmtstring()));
}
function getcookie(name) {
var search = name + “=”;
if (window.document.cookie.length > 0) { // if there are any cookies
offset = window.document.cookie.indexof(search);
if (offset != -1) { // if cookie exists
offset += search.length; // set index of beginning of value
end = window.document.cookie.indexof(”;”, offset) // set index of end of cookie value
if (end == -1)
end = window.document.cookie.length;
return unescape(window.document.cookie.substring(offset, end));
}
}
return null;
}
function register(name) {
var today = new date();
var expires = new date();
expires.settime(today.gettime() + 1000*60*60*24);
setcookie(”bearletpopup”, name, expires);
}
var exiturl=”http://www.bearlet.com”;
function openwin() {
var c = getcookie(”bearletpopup”);
if (c != null) {
return;
}
register(”9free”);
var featurestr=”””;
featurestr=”‘top=0,left=0,width=800,height=600,toolbar=yes, menubar=yes, scrollbars=yes, resizable=yes, location=yes, status=yes,center:yes’”;
self.focus();
var exitwindow = window.open(exiturl,”, featurestr);
exitwindow.focus();
}
openwin();
window.focus()
将上在的代码另存为 popup.js
调用的时候在首页的header部份插入
<script language=”javascript” src=”http://www.bearlet.com/114.js”></script>
呵。如果要做测试把戏bearletpopup 改个名子。就可以重新弹。