1

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.

JITSU83
  • 69
  • 1
  • 3
  • 10

2 Answers2

2

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/

athms
  • 948
  • 5
  • 8
  • thanks athams,can you give me some example how I can make absolute positioned div work as ModalDialog. – JITSU83 Jul 04 '14 at 04:06
  • 1
    @JITSU83 have a look at this quick JSFiddle I put together: http://jsfiddle.net/85wNA/ – athms Jul 04 '14 at 11:43
0

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')