如题,关闭一个模态窗口(点窗口上面的X),怎么才能弹出一个新的窗口或是模态窗口。我的代码:
<a onclick="window.showModalDialog('1.html')">dsdfasfasf</a>1.html代码
<body onunload="window.showModalDialog('http:\/\/www.163.com')">
</body>
关闭1.html 应该弹出163.com,但是什么反应也没有
<a onclick="window.showModalDialog('1.html')">dsdfasfasf</a>1.html代码
<body onunload="window.showModalDialog('http:\/\/www.163.com')">
</body>
关闭1.html 应该弹出163.com,但是什么反应也没有
<head>
<title>无标题页</title>
<script language="javascript">
function openwin()
{
var url="1.htm"; var mydata=showModalDialog(url,null,"dialogWidth:300px;dialogHeight:120px;center:yes;help:No;status:no;resizable:Yes;edge:sunken");
if(mydata)
window.showModalDialog('http:\/\/www.163.com');
}
</script>
</head>
<body>
<input id="Button1" type="button" value="打开窗口" onclick="openwin()" />
</body>
</html>
1.html
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>标题页</title>
<script language=javascript>
function ReturnWin()
{
var returnData=new Object(); //创建变量
returnData.value=document.getElementById("Text1").value; //设置变量的值
window.returnValue=returnData; //窗体返回数据
window.close(); //关闭窗口
}
</script>
</head>
<body>
<input id="Text1" type="text" /><input id="Button1" type="button" value="返回" onclick="ReturnWin()" />
</body>
</html>
<head>
<title>标题页</title>
<script language=javascript>
function ReturnWin()
{
var returnData=new Object(); //创建变量
returnData.value=1 //设置变量的值
window.returnValue=returnData; //窗体返回数据
window.close(); //关闭窗口
}
</script>
</head>
<body onunload="ReturnWin()">
</body>
</html>
这就是你要的效果
这里定义的