ITeye博客

仅弹出一次的窗口

cui09 · 2007-04-01 12:27 · Markdown

如果想看程序运行效果,请先点击阅读全文,然后再点击代码即可.

<body bgcolor="#ffffff" onunload="loadpopup()">

<SCRIPT language="JavaScript">
<!--
function openpopup(){
window.open("http://fishcat.blog.com.cn/","","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) { // if cookie exists
      offset += search.length
      // set index of beginning of value
      end = document.cookie.indexOf(";", offset);
      // set index of end of cookie value
      if (end == -1)
         end = document.cookie.length;
      returnvalue="http://www.blog.com.cn/unescape(document.cookie.substring(offset," end))
      }
   }
  return returnvalue;
}

function loadpopup(){
if (get_cookie('popped')==''){
openpopup()
document.cookie="popped=yes"
}
}

//-->
</SCRIPT>

</body>

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。