你的位置: Kiyo'Space首页 JavaScript/Jscript 阅读文章 欢迎留下您的足迹

只弹出一次的窗口

[ JavaScript/Jscript ] 分享

 

function openwin(){  
window.open("pop1.html","","width=120,height=240")  
}  
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 loadpopup(){ //*控制弹出窗口的函数哟,你要使用他的啊  
if (get_cookie(‘popped’)==”){  
openwin()  
document.cookie="popped=yes"  
}
  
}

FROM:http://www.cnblogs.com/edsky/articles/363086.html

没有评论

  • (Required)
  • (Required, will not be published)