Reputation: 69
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.
Upvotes: 1
Views: 10415
Reputation: 1
You're using parameters for window.open()...
window.open('http://www.google.com','width=950, height=950, scrollbars=0')
but showModalDialog has different parameters, and colons instead of equals: window.showModalDialog('http://www.google.com', 'popWin', 'dialogHeight:950, dialogWidth:950, scroll:no')
Upvotes: 0
Reputation: 958
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/
Upvotes: 2