<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 1</title>
</head><body>
<input type=text id=tt>
<script language="javascript">
<!--
document.all.tt.value = window.showModalDialog("pass.htm");
//-->
</script>
</body></html>
pass.htm<html>
<script language="JavaScript">
function check(){
window.returnValue="kkkkkkkk";
window.close();
}
</script>
<body>
<form name="aForm" method="post" action="">
<table width="200" hight="100" border="0" align="center">
<tr>
<TD>
<input type="button" name="button" onClick="check();" value="确定">
</TD>
</TR>
</TABLE>
</form>
</body>
</html>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 1</title>
</head><body>
<input type=text id=tt>
<script language="javascript">
<!--
document.all.tt.value = window.showModalDialog("pass.htm");
//-->
</script>
</body></html>
pass.htm<html>
<script language="JavaScript">
function check(){
window.returnValue="kkkkkkkk";
window.close();
}
</script>
<body>
<form name="aForm" method="post" action="">
<table width="200" hight="100" border="0" align="center">
<tr>
<TD>
<input type="button" name="button" onClick="check();" value="确定">
</TD>
</TR>
</TABLE>
</form>
</body>
</html>
解决方案 »
- 这里面的图片怎么换成自己的啊,我改了很多次都没有成功,帮帮我!!
- jquery easyui tree怎么用代码修改节点名称和指定区域可拖到及不可拖动
- jquery插件动态改变option中的内容
- 发帖问“hch126163 老胡”一个js的问题,有兴趣的也进来看一下啊
- js文件最后加载如何实现【csdn的高人进来】
- javascript:openurl() 问题
- 如何刷新指定框架中的指定链接的页面?(要求进入该链接页面时刷新一次即可)
- treegrid 问题
- 怎么设置ID、密码登陆,在线等,急~~大虾、高手请帮忙
- 有一个javascript的问题,请高手指点!谢谢!
- 在javascript中,焦点能往回走吗?能跳过一个,直接进入下一个吗(在线等待)
- 可以用JAVASCRIPT调用系统目录下的一个*.exe文件吗?
这句有问题吧你可以将返回值alert出来试试
<script language="JavaScript">
function check(){
window.returnValue="kkkkkkkk";
window.close();
}
</script>
<body onunload="check()">
<form name="aForm" method="post" action="">
<table width="200" hight="100" border="0" align="center">
<tr>
<TD>
<input type="button" name="button" onClick="check();" value="确定">
</TD>
</TR>
</TABLE>
</form>
</body>
</html>
解决的方法也很简单,只要在model dialog的页面的onload事件中对returnValue进行赋值就可以了
document.aForm.text.value = window.showModalDialog("pass.html");
这句有问题
document.aForm.text.value = window.showModalDialog("pass.html");
这句没问题
<head>
<script language="JavaScript">
window.returnValue=-1;
</script>
</head>
var rv=window.showModalDialog("pass.html",null,"");
if(!rv)
{}