")
  OpenWindow.document.write("")
  OpenWindow.document.write("

Hello!

")
  OpenWindow.document.write("New window opened!")
  OpenWindow.document.write("")
  OpenWindow.document.write("")
  OpenWindow.document.close()
  }
  
  
  

350vip浦京集团-新浦金350vip-欢迎莅临!


  打开一个窗口
  
  
  
      OpenWindow.document.write()里面的代码不就是标准的HTML吗?只要按照 格式写更多的行即可。千万注意多一个标签或少一个标签就会出现错误。记得用 OpenWindow.document.close()结束啊。

9, 终极应用---弹出的窗口这Cookie控制
    回想一下,上面的弹出窗口虽然酷,但是有一点小毛病,比如你将上面的脚本放在一个需要频繁经过的页面里(例如首页),那么每次刷新这个页面,窗口都会弹出一次,是不是非常烦人?
    有解决的办法吗?我们使用cookie来控制即可。
    首先,将如下代码加入主页面的Html的head区:
   function openwin(){
  window.open("page.html","","width=200,height=200")
  }
      function get_cookie(Name)
      {
       var search=Name+"=";
       var returnvalue="";
       if(document.cookie.length>0){
      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 ladpopup()
      {
      if(get_cookie('popped=yes'))
      {
      openwin()
      document.cookie="popped=yes";
      }
      }
     最后,用

350vip浦京集团-新浦金350vip-欢迎莅临!


西安350vip浦京集团 | 西安做网站 —— 剑锋所指 所向披靡!
回复

使用道具 举报

返回列表 发新帖
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|小黑屋|手机版|Archiver|西安350vip浦京集团

GMT+8, 2024-9-5 00:07 , Processed in 0.043457 second(s), 16 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表