Click here to Skip to main content
15,064,072 members
Please Sign up or sign in to vote.
5.00/5 (11 votes)
See more:
Following code is working fine in following browser:

  • IF
  • Mozilla
  • Safari

but it is not working in
  • Google Chrome 5.0.3

var returnValue = window.showModalDialog("popup.aspx?", "window", "dialogWidth:390px;dialogHeight:180px;scroll:no;");

Your answer will be appreciated!

Svetlin Panayotov 21-Sep-10 7:15am
Sadly, yes. Last time I tried using showModalDialog it worked in Chrome, but the same way works - the window was not modal. It won't work in Opera as well, so the only thing that comes to mind is using Jquery UI's Dialog.
Suk@nta 8-Jan-14 3:56am
yes i have also tried it in one of my project .it will work..
Sandeep Mewara 21-Sep-10 13:41pm
Try jQuery dialogs...

I found Google has (had) some issues with the showModalDialog. You can follow the status of the problem right here[^].

Good luck!

You are right window.showModalDialog() doesn't work with the latest updated version of Google Chrome, i too faced this problem in my project.

You can have a number of solutions for that :-

1. The easiest one is;

Pros:- Easy to handle and use.
Cons:- You can still work on the parent page while the pop-up window is opened.

2. The Efficient solution is to use jQuery dialog control.
For better understanding of jQuery dialog control you can refer the
link "[^]"

i do it one of my project .it will work .i think theire might be some issue..try again

window.showModalDialog("popup.aspx?", true, 'dialogHeight:150px;dialogWidth:500px');

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900