The Google showModalDialog () method is not compatible with the dialog window solution. Google showmodaldialog
ShowModalDialog: During the test, IE and Firefox run normally, but in google, there is no response after clicking it. I checked it online, google Chrome does not support showModalDialog modal dialog box and cannot return returnValue. A solution is provided.
<Script type = "text/javascript"> // enable the mode Window function showMyModal () {var url = "SelectUser. aspx "; // input parameter example var modalReturnValue = myShowModalDialog (url, window, 300,500); // alert (modalReturnValue. name); // After the window is closed, execute some methods // TODO something} // the pop-up box google Chrome executes openfunction myShowModalDialog (url, args, width, height) {var tempReturnValue; if (navigator. userAgent. indexOf ("Chrome")> 0) {var paramsChrome = 'height = '+ height +', width = '+ width +', top = '+ (window. screen. height-height)/2)-50) + ', left =' + (window. screen. width-width)/2) + ', toolbar = no, menubar = no, scrollbars = no, resizable = no, location = no, status = no'; window. open (url, "newwindow", paramsChrome);} else {var params = 'dialogwidth: '+ width + 'px; dialogHeight:' + height + 'px; status: no; dialogLeft: '+ (window. screen. width-width)/2) + 'px; dialogTop: '+ (window. screen. height-height)/2)-50) + 'px; '; tempReturnValue = window. showModalDialog (url, args, params) ;}return tempReturnValue ;}</script>
Finally, you can click to display the dialog box. You only need to use The onclick event to call the method.
The above section describes how to analyze and solve problems in dialog windows that are incompatible with the Google showModalDialog () method, hoping to help you.
Articles you may be interested in:
- Solution for showModalDialog to return Null in Google Chrome
- Google Chrome does not support the solution to the showModalDialog Modal Dialog Box