模式窗口值传递,window.returnValue的用法
2010-07-20 14:09
411 查看
parent.html
<HTML>
<HEAD>
<TITLE></TITLE>
<script language="javascript">
function showmodal(){
var ret = window.showModalDialog("child.htm",null,"dialogWidth:350px;dialogHeight:350px;help:no;status:no");
if (ret){alert('子窗口返回真!');
}else{
alert('子窗口返回假!');
}
}
</script>
</HEAD>
<BODY>
<INPUT id=button1 type=button value=Button name=button1 onclick="showmodal();">
</BODY>
</HTML>
child.html
<HTML>
<HEAD>
<TITLE></TITLE>
<script language="javascript">
function trans(tag){
if (tag==0){
window.returnValue=false;
} else{
window.returnValue =true;
}
window.close();
}
</script>
</HEAD>
<BODY>
<table>
<tr>
<td>
<INPUT id=button1 type=button value="返回真" name=button1 onclick="trans(1)">
</td>
<td>
<INPUT id=button2 type=button value="返回假" name=button2 onclick="trans(0)">
</td>
</tr>
</table>
</BODY>
</HTML>
<HTML>
<HEAD>
<TITLE></TITLE>
<script language="javascript">
function showmodal(){
var ret = window.showModalDialog("child.htm",null,"dialogWidth:350px;dialogHeight:350px;help:no;status:no");
if (ret){alert('子窗口返回真!');
}else{
alert('子窗口返回假!');
}
}
</script>
</HEAD>
<BODY>
<INPUT id=button1 type=button value=Button name=button1 onclick="showmodal();">
</BODY>
</HTML>
child.html
<HTML>
<HEAD>
<TITLE></TITLE>
<script language="javascript">
function trans(tag){
if (tag==0){
window.returnValue=false;
} else{
window.returnValue =true;
}
window.close();
}
</script>
</HEAD>
<BODY>
<table>
<tr>
<td>
<INPUT id=button1 type=button value="返回真" name=button1 onclick="trans(1)">
</td>
<td>
<INPUT id=button2 type=button value="返回假" name=button2 onclick="trans(0)">
</td>
</tr>
</table>
</BODY>
</HTML>
相关文章推荐
- window.returnValue的用法
- asp.net 模式窗口用法 window.showModalDialog()
- 模式窗口window.showModalDialog()的用法
- window.returnValue的用法
- window.returnValue 用法
- window.returnValue的用法
- Window.returnValue opener parent 的用法
- 模式窗口window.showModalDialog()的用法
- window.returnValue的用法
- 弹出模式窗口的returnValue问题
- window.event.returnValue=false 防止打开新窗口时,原窗口滑到顶部
- 模式窗口showModalDialog的用法总结
- window.returnValue = 00000000; window.close();
- window.showModalDialog() + window.returnValue
- window.showModalDialog方式/模式窗口数据不刷新(缓存)问题
- window.returnValue使用方法(转)
- window.returnValue使用方法
- window.returnValue使用方法示例介绍
- 模式窗口showModalDialog的用法总结
- ie中的window模式窗口