Double-click domain implementation: http://blog.csdn.net/gaopeng0071/article/details/21179619,
In this blog post, double-click domain implementation is described, and browser compatibility problems are found in the window. showModalDialog modal box.
When chrome is used, the return value of the modal box cannot be returned to the parent page. This method is used: window. returnValue
- From: http://blog.csdn.net/luckzhang_la/article/details/17262421
This method has browser compatibility issues. Browsers using the ie Kernel support this method, but browsers using the Google kernel (such as Chrome) do not.
The window. showModalDialog () method is not supported. Browsers using the Google kernel do not open a mode pop-up box but window. open (). In this way, set the return value window in the pop-up box. returnValue = "Return Value"; var vReturnValue = window when the parent form is obtained. showModalDialog (sURL [, vArguments] [, sFeatures]) found that vReturnValue is undefined.
The solution is as follows:
Parent page:
For more information, see Row 3 and row 3.
function ondbGuanLianADId(){adId = window.showModalDialog('getAdForMac.action', null ,'dialogHeight=500px; dialogWidth=420px;');var strs = adId; if(strs==undefined){ strs=window.returnValue; }if(strs != undefined){document.getElementById("guanLianADId").value = strs.split(":")[0];document.getElementById("guanLianADName").value = strs.split(":")[1];}}
Subpage:
Function test () {// solves the version difference between IE and chrome. if (window. opener! = Undefined) {// for chrome window. opener. returnValue = document. getElementById ("name1 "). value;} else {window. returnValue = document. getElementById ("name1 "). value;} window. close ();}
Reference resources: http://blog.csdn.net/luckzhang_la/article/details/17262421