Solve the chrome browser can not get the return value of the problem window.showModalDialog

Parent page processing:

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 browser can not be solved window.showModalDialog return value problem
      window.document.getElementById ( "test") value = window.returnValue.;

   }
}

Subpages process:

 

Button_Submit_onclick function ()
{
    IF (! window.opener = undefined) {
       // chrome browser can not be solved window.showModalDialog return value problem
       window.opener.returnValue = "opener returnValue";
    }
    the else {
       window.returnValue = "window the returnValue ";
    }
    the window.close ();
}

 

Reproduced in: https: //www.cnblogs.com/cy-across-I/p/3793313.html

Guess you like

Origin blog.csdn.net/weixin_33912246/article/details/94107954