1. Home
  2. Computing & Technology
  3. JavaScript
photo of Stephen Chapman
Stephen's JavaScript Blog

By Stephen Chapman, About.com Guide to JavaScript since 2004

Modal Windows

Thursday October 2, 2008
Few browsers support making modal windows

There is no standard way to make a popup window into a modal dialog box. Both Internet Explorer and the Mozilla based browsers (including Firefox and Netscape 6+) provide a method of making your popup window stay in front of the other windows but the methods used to do this are entirely different. Other browsers don't support creating your own modal dialog window at all. By combining code together to test which method is supported by the browser you can create a popup that will maintain the focus in those browsers that support it and which will still popup in other browsers that don't support modal windows. Always assuming that it isn't blocked by a popup blocker of course.

Modal Windows
Comments

No comments yet. Leave a Comment

Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>

Explore JavaScript
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. JavaScript

©2009 About.com, a part of The New York Times Company.

All rights reserved.