athlon

只弹出一次的公告效果

调用弹出页面代码main.htm:
 
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 2<html>
 3    <head>
 4        <meta http-equiv="Content-Type" content="text/html; charset=GB2312">
 5        <link href="../style/piccm_style.css" rel="stylesheet" type="text/css">
 6        <title>
 7          演示
 8        </title>    
 9        <script language="JavaScript" type="text/JavaScript">
10            <!--
11function openwindow()
12{
13    window.open('left.html','Download','top='+(screen.height-115)/2+',left='+(screen.width-325)/2+',width=325,height=115,toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no','false');
14}

15
16
17function get_cookie(Name) {
18var search = Name + "="
19var returnvalue = "";
20if (document.cookie.length > 0{offset = document.cookie.indexOf(search)
21    if (offset != -1{offset += search.length;end = document.cookie.indexOf(";", offset);
22    if (end == -1)end = document.cookie.length;returnvalue=unescape(document.cookie.substring(offset, end))}

23}

24return returnvalue;
25}

26function ad(){
27    alert(window.opener);
28if (get_cookie('exist')==''){
29openwindow(); //调用window.open;
30}

31else {
32    alert("不弹出窗口");
33    }

34}

35
</script>
36
37    </head>
38
39
40    <body>
41        <script>
42       ad();
43        
</script>
44</body>
45</html>
46
弹出页面left.html
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charsGB2312312">

<title>Insert title here</title>
</head>
<body>
    
<script>
        document.cookie
="exist=yes";
      window.onunload
=function(){
           
var date = new Date();
           document.cookie 
= "exist = ; expires=" + date.toGMTString();
           }
;
    
</script>
<table width="100%" height="10%"  border="0" cellpadding="0" cellspacing="0">
<br>
<br>
  
<tr>
    
<td valign="top">
     
<input type="text" name="ulfile" size="40" >      
    
</td>
  
</tr>
</table>
    
</td>
  
</tr> 
</table>

</body>
</html>

posted on 2007-07-11 09:23 书上有 阅读(28) 评论(0)  编辑  收藏


只有注册用户登录后才能发表评论。


网站导航:
 
<2025年7月>
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789

导航

统计

留言簿

文章档案

搜索

最新评论