从IE7(Parent)到IE9 Child的window.ShowModalDialog没有得到window.dialogArguments [英] Not getting window.dialogArguments from window.ShowModalDialog from IE7(Parent) to IE9 Child

查看:105
本文介绍了从IE7(Parent)到IE9 Child的window.ShowModalDialog没有得到window.dialogArguments的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



所有我从我的asp.net应用程序调用Window.ShowModalDialog()。我的浏览器版本是IE7

而我的Modal弹出窗口来自另一台服务器,那里的IE版本是IE9。我没有从模态弹出窗口中获取返回值。



退出模态弹出窗口我使用下面的代码。

< pre lang =javascript> var MyArgs = {a,b,c};
window .returnvalue = true ;
window .returnValue = MyArgs;
window .close();





在本地申请中我正在使用此代码

  var  MyArgs =  window .showModalDialog(url +  ?a = + a,MyArgs,'  dialogHeight:450px; dialogWidth:750px; center:Yes; resizable:Yes; status:No;'  true); 

if (MyArgs。 String .length> 1)
{
// 这里我收到错误(MyArgs未找到。
}



请帮助我。提前谢谢

解决方案

Hello Murthy,



这是showModalDialog中的已知问题。请参阅以下链接。



如果你真的想要返回一个数组并访问它我建议您如下所示克隆它或使用字符串作为返回值。

  //  在调用页面(TestDialog.htm) 
function cloneArray(ary) {
var i;
var newAry = [];
for (i = 0 ; i< ary.length; i ++){
if (Object.prototype.toString.call(ary [i])== ' [object Array]'){
newAry.push(cloneArray(ary [i]));
} 其他 {
newAry.push(ary [i]);
}
}
返回 newAry;
}

// 此函数打开一个对话框并读取返回值和显示它,
function fnOpen(){
var sFeatures = fnSetValues();
window .returnValue = undefined ;
var retVal = window .showModalDialog( http:// localhost:8080 / myapp / dialog.htm ,sFeatures)
alert(cloneArray(retVal));
}



问候,


Hi,
All I am calling Window.ShowModalDialog() from my asp.net application. My browser version is IE7
and my Modal popup come from another server, there IE version is IE9. I am not getting return values from the modal popup window.

while exit from modal popup window i am using the below code.

var MyArgs = {a,b,c};
window.returnvalue = true;
window.returnValue = MyArgs;
window.close();



In local application i am using this code

var MyArgs = window.showModalDialog(url + "?a=" + a, MyArgs, 'dialogHeight:450px; dialogWidth: 750px; center: Yes; resizable: Yes; status: No;', "true");

if(MyArgs.String.length>1)
{
//here i am getting error (MyArgs is undefinied.
}


Plese help me.Thanks in advance

解决方案

Hello Murthy,

This is a known problem in showModalDialog. See following links.

If you really want to return an array and access it I suggest you clone it as shown below or use a string as return value.

// In the calling page (TestDialog.htm)
function cloneArray(ary) {
    var i;
    var newAry = [];
    for (i = 0; i < ary.length; i++){
        if (Object.prototype.toString.call(ary[i]) == '[object Array]') {
            newAry.push(cloneArray(ary[i]));
        } else {
            newAry.push(ary[i]);
        }
    }
    return newAry;
}

// This function open a dialog and reads the return value and displays it,
function fnOpen() {
    var sFeatures = fnSetValues();
    window.returnValue = undefined;
    var retVal = window.showModalDialog("http://localhost:8080/myapp/dialog.htm", "", sFeatures)
    alert(cloneArray(retVal));
}


Regards,


这篇关于从IE7(Parent)到IE9 Child的window.ShowModalDialog没有得到window.dialogArguments的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆