2004-11-18, 12:22 AM
|
#1
|
注册日期: 2003-10-22
帖子: 11,053
积分:6
精华:24
现金:14348金币
资产:29325305金币
|
只弹出一次的窗口的JS代码
PHP 代码:
<html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <script> function openpopup(){ window.open("anowdo.htm","","width=300,height=300") //自己修改弹出窗口 } function get_cookie(Name) { var search = Name + "=" var returnvalue = ""; if (document.cookie.length > 0) { offset = document.cookie.indexOf(search) if (offset != -1) { //如果 cookie 已经存在 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')==''){ openpopup() document.cookie="popped=yes" } } </script> </head> <body onload="loadpopup()"> </body> </html>
|
|
|
|