Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

window.showModalDialog is not working on Netscape

Status
Not open for further replies.

nomy

Programmer
Jul 20, 1999
23
PK
window.showModalDialog is not working on Netscape....<br>It is working fine on Internet Explorer.<br>
 
to my understanding. this method is not supported by any version of netscape<br><br><A HREF="mailto:jared@aauser.com">jared@aauser.com</A>
 
You can accomplish essentially the same thing on Netscape, but you have to do a few tricks with window.open() and Javascript to emulate the showmodalDialog function.
 
How do you do this ryc? A modal is a very difficult thing to fake (it stops the current thread of execution I think.)<br><br><br><A HREF="mailto:jared@aauser.com">jared@aauser.com</A>
 
It would take a bit of work to emulate stopping the current thread of execution, but with Javascript, that's hardly ever a serious concern. Mainly what you want is a function that pops up a set of controls for the user to make choices, and then returns a value or array of values upon which to continue execution. <br><br>The IE showModaldialog() is just an HTML page wrapped in a dialog, with the nifty feature of being able to do:<br><br>window.returnValue=foo;<br>window.close();<br><br>It also prevents the user from doing anything else until the dialog is dealt with.<br><br>In Netscape, you would have to accomplish that with some trickery. In the &lt;body&gt; of the popup window you could do onblur=&quot;this.focus()&quot; to return the focus to the popup until it is closed. (I believe this will do the trick, but if not, let me know)<br><br>Secondly, rather than being able to set window.returnValue, you would just do something like<br><br>top.opener.my_returnvaluefunction(foo);<br>//where foo is your 'return' value<br>window.close();<br><br>So essentially, with IE, you can have one function, which is halted in the middle to make user choices. In Netscape, you would have two functions; one to set up the modal dialog, and the second to continue the stream of execution.
 
showmodaldialog() is an extension introduced in IE 4. [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top