87,904
社区成员
发帖
与我相关
我的任务
分享
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script type="text/javascript">
<!--
//打开一个模式窗口
function showModal(){
showModalDialog('showModal.html',window,'dialogWidth=475px;dialogHeight=235px;status=no;help=no;scrollbars=no');
}
-->
</script>
</head>
<body>
<input type="button" name="sub" id="sub" onclick="showModal()" value="submit"/>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled2</title>
<script type="text/javascript">
function winClose()//装载事件控制自己规定时间后关闭
{
window.setTimeout("window.close()",3000);
}
</script>
</head>
<body onload="winClose()">
The window will be closed!!<br>
</body>
</html>
<script>
var win2, win3;
function open2(){
win2 = open("2.html");
setTimeout("close2()",5000);
}
function open3(){
win3 = open("3.html");
setTimeout("close3()",5000);
}
function close2(){
win2.close();
}
function close3(){
win3.close();
}
</script>
<a href="javascript:open2();void(0);">open 2</a>
<a href="javascript:open3();void(0);">open 3</a>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<script language="javascript">
var win;
function openAndClose(url,t)
{
win = window.open(url);
window.setTimeout("win.close()",t);
}
</script>
<a href="#" onclick="javascript:openAndClose('http://www.baidu.com',5000)">baidu</a>
<a href="#" onclick="javascript:openAndClose('http://g.cn',5000)">google</a>
</body>
</html>