spacer
Yehuda Shiran June 13, 2000
Modal Windows in Netscape
Tips: June 2000

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
Google Chrome Playing Catch-Up on Extensions
Open Solutions Alliance Gets New Leadership
Red Hat Spacewalk Expands Linux Management
JavaScript features several built-in dialog boxes: window.alert(), window.confirm(), and window.prompt(). When a dialog box pops up, the user cannot focus on the original page until the box is terminated. In other words, a dialog box is always focused. Internet Explorer supports a few methods that enable you to apply this feature to any new window:

showModalDialog() (Internet Explorer 4 and above)
showModelessDialog() (Internet Explorer 5 and above)
You can achieve a similar effect in Navigator by specifying the onBlur event handler:

<BODY onBlur="window.focus()">

If you use the above event handler in the <BODY> tag, the window holding the document remains focused until the user closes it. There are several differences between this Navigator-only technique and Internet Explorer's showModalDialog() method. First of all, the focused window isn't associated with a specific window (or document). That is, the user cannot bring up any other browser window, even if it isn't the window that opened the dialog window. In addition, the user can still bring up a different window for a moment, which is enough to close the opener window while the "modal" dialog is open.

For more on modal windows, go to Working with Windows - Dialog Boxes.


People who read this tip also read these tips:

Look for similar tips by subject:

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

webref The latest from WebReference.com Browse >
Popular JavaScript Framework Libraries: An Overview - Part 3 · Accessing Your MySQL Database from the Web with PHP · Working with the DOM Stylesheets Collection
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
MS Access and MySQL · Cisco AutoQoS: VoIP QoS for Mere Mortals · While VoIP Adoption Explodes in Enterprise, Carrier Spending Lags