test1.htm页是这样的
</script>
function openw()
{
var mxh1 = new Array("mxh","net_lover","孟子E章");
// 向对话框传递数组
var a= window.showModalDialog("test2.htm",mxh1);
document.all.Button1.value =a[0];
alert(a[0]); }
</script>
test2.htm是这样的
function clo()
{
var a=new Array("a","b")
window.returnValue = a
window.close()
}
</script>
...........
<input value="按钮" type=button onclick="javascript:clo()"/>如果我打开第一个页test1.htm,那么打开一个模态窗口test2.htm ,点test2.htm 的按钮后就会
关闭,并向第一个页传值。都很正常,那我要是直接把test2.htm关闭了的话就会报错
'0'为空或不是对象,那我怎么判断 它呀?我试了 returnValue ="" returnValue ==Nan
都不行,高手回答一下吧
</script>
function openw()
{
var mxh1 = new Array("mxh","net_lover","孟子E章");
// 向对话框传递数组
var a= window.showModalDialog("test2.htm",mxh1);
document.all.Button1.value =a[0];
alert(a[0]); }
</script>
test2.htm是这样的
function clo()
{
var a=new Array("a","b")
window.returnValue = a
window.close()
}
</script>
...........
<input value="按钮" type=button onclick="javascript:clo()"/>如果我打开第一个页test1.htm,那么打开一个模态窗口test2.htm ,点test2.htm 的按钮后就会
关闭,并向第一个页传值。都很正常,那我要是直接把test2.htm关闭了的话就会报错
'0'为空或不是对象,那我怎么判断 它呀?我试了 returnValue ="" returnValue ==Nan
都不行,高手回答一下吧
解决方案 »
- GridView中详情页面跳转
- 编译器错误信息: CS1502: 与“System.Data.SqlClient.SqlCommand.SqlCommand(string, System.Da
- HTML转译问题!
- ASP.NET 报错问题
- *W*问一个关于多线程的问题
- 这样写代码哪出问题了?
- [现金求购] 一个网站的十二个功能模块的动态网页
- 样式表必须是当前项目的一部分 什么意思
- 怎样在水晶报表中显示两个库的金额汇总?
- DropDownList 的问题
- ■为什么不能在VS2003中新建项目?
- 在线急等:dotnet检测到指定的web 服务器不是asp.net1.1版本,不能在当前位置创建web应用程序和服务
if (a != null)
{
document.all.Button1.value =a[0];
alert(a[0]);
}or maybe you should set window.returnValue in onunload event in your test2.html: