The Google showModalDialog () method is not compatible with the dialog window solution. Google showmodaldialog

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.