87,921
社区成员
发帖
与我相关
我的任务
分享
<html>
<head>
<script language="javascript">
function openurl(){
var u="bb.htm";
var s="width=400,height=200,top=100,left=400";
window.open(u,"window1",s);
}
</script>
</head>
<body>
<input type="button" value="打开bb.htm" onClick="openurl()">
</body>
</html>
<html>
<head>
<script language="javascript">
function show(){
document.getElementById("div0").style.display="none";
document.getElementById("div1").style.display="";
}
function chang(){
var cook=document.cookie;
if(cook!=""){
show();
}else{
setTimeout("show()",5000); //5秒钟后改变页面内容
document.cookie = "opened=yes";
}
}
function delcook(){
var expires = new Date();
expires.setTime(expires.getTime()-1);
document.cookie = "opened=yes;expires="+expires.toGMTString();
}
</script>
</head>
<body onLoad="focus();chang()" style="text-align:center">
<div id="div0" style="border:1px solid black;width:80%;padding:10px;">
<b>5秒钟后改变本页的内容</b><br><br>
这是第一次弹出本页时显示的XXXX内容.这是第一次弹出本页时显示的XXXX内容.
这是第一次弹出本页时显示的XXXX内容.这是第一次弹出本页时显示的XXXX内容.
这是第一次弹出本页时显示的XXXX内容.这是第一次弹出本页时显示的XXXX内容.
</div>
<div id="div1" style="border:1px solid black;width:80%;padding:10px;display:none">
显示的YYYYYY内容.显示的YYYYYY内容.显示的YYYYYY内容.
显示的YYYYYY内容.显示的YYYYYY内容.显示的YYYYYY内容.
显示的YYYYYY内容.显示的YYYYYY内容.
<br><br>
<input type="button" value="删除Cookie" onClick="delcook()">
</div>
</body>
</html>