javascripthtmlinternet-explorer-11ie11-developer-tools

showModalDialog() not working as expected in IE11 browser


I am trying to create a POP UP of variable size using window.showModalDailog() method. But it always open to default small size window.

<html>
<body>
<a href="#" onclick="javascript:void window.showModalDialog('http://www.google.com','width=950,height=950,toolbar=0,menubar=0,location=0,status=1,scrollbars=0,resizable=0,left=0,top=0');return false;">Pop-up Window</a>
</body>
</html>

ISSUE: above code doesn't get open window of size (950*950), inspite everytime it open a default small size window in IE11.


Solution

  • showModalDialog is very likely to be deprecated soon (see http://dev.opera.com/articles/showmodaldialog/ ) and so I would advise against using it.

    Just use an absolute positioned div to display your HTML content, or implement a jQueryUI dialog for ease of use: http://jqueryui.com/dialog/