解决chrome浏览器无法得到window.showModalDialog返回值的问题

父页面处理:

function ProductList()
{
   var TypeID = window.document.getElementById("Type").value;
   var returnvalues = window.showModalDialog('ProductList.aspx?Type=' + TypeID,'window','dialogWidth=700px;dialogHeight=680px');
   if(returnvalues!=undefined){
       window.document.getElementById("test").value=returnvalues;
   }

   else{//解决chrome浏览器无法得到window.showModalDialog返回值的问题
      window.document.getElementById("test").value=window.returnValue;

   }
}

子页面处理:

 

function Button_Submit_onclick()
{
    if (window.opener != undefined) {
       //解决chrome浏览器无法得到window.showModalDialog返回值的问题
       window.opener.returnValue ="opener returnValue";
    }
    else {
       window.returnValue="window returnValue";
    }
    window.close();
}

 

转载于:https://www.cnblogs.com/c-y-across-I/p/3793313.html

猜你喜欢

转载自blog.csdn.net/weixin_33912246/article/details/94107954