Javascript window.returnValue返回未定义的IE7

Javascript window.returnValue返回未定义的IE7,javascript,internet-explorer,internet-explorer-7,Javascript,Internet Explorer,Internet Explorer 7,我正在编写一个内部网系统,我必须使用IE7 在IE7中有一个名为“window.showmodaldialog”的方法,该方法应该返回在模式中传递的值,如:window.returnValue=“some string” 我的代码是 index.jsp var result = window.showmodaldialog(url) modal.jsp: window.returnValue = "some string" var jsonReturn = {"one_tag": "som

我正在编写一个内部网系统,我必须使用IE7

在IE7中有一个名为“window.showmodaldialog”的方法,该方法应该返回在模式中传递的值,如:window.returnValue=“some string”

我的代码是 index.jsp

var result = window.showmodaldialog(url)
modal.jsp:

window.returnValue = "some string"
 var jsonReturn = {"one_tag": "some value", "id": "id"};
 jsonReturn = JSON.stringify(jsonReturn);
 window.returnValue = jsonReturn;
 window.close();
但是当我关闭模式时,“result”变量总是未定义的。域和协议是相同的。并且window.opener未定义

在modal.jsp中,遗留系统会进行一些刷新和重定向,我们必须保持这种方式。这就是问题所在吗?如果是,有办法解决吗?我真的需要继续使用window.returnValue,因为系统可以打开我没有源代码的其他模型

编辑: 添加有关modal.jsp的更多信息:

window.returnValue = "some string"
 var jsonReturn = {"one_tag": "some value", "id": "id"};
 jsonReturn = JSON.stringify(jsonReturn);
 window.returnValue = jsonReturn;
 window.close();

一些选择框将表单提交到modal.jsp,使页面刷新。

听起来很奇怪,对话框一直是“IE最好的部分”,到目前为止,它们的工作方式与预期一致。你能详细说明什么是“刷新和重定向”,以及它们发生的阶段吗?您能否提供更多的代码,特别是主页中
showModalDialog()
之后立即发生的代码,以及为对话框中的
returnValue
赋值后的代码?刷新和重定向是表单提交到同一url的过程。我真的认为它是在某种程度上返回另一个窗口的window.returnValue,但我不知道如何返回。IE7中不支持
JSON
,IE>=8。奇怪的是,如果模态对话框中没有任何错误…很抱歉,我忘了提到,我在IE7中使用了一个库来允许JSON。我发现了错误,有人放了一个名为“returnValue”的函数,因为js中的所有内容都在窗口中。该函数重写了默认IE变量。