A Programmer's Dream

Learn something new everyday...

Posted by Stephen Wrighton on 19 Jul 2007

Apparently IE has a modal option for JavaScript to launch new windows.

I can't see it being truly useful though, as it's not supported in Firefox or Opera.

Anyway, the functionality in JavaScript looks like this:
Function modalWin() {
if (window.showModalDialog) {

window.showModalDialog("xpopupex.htm","name", "dialogWidth:255px; dialogHeight:250px");

} else {

window.open('xpopupex.htm','name', 'height=255,width=250, toolbar=no,directories=no,status=no, menubar=no,scrollbars=no, resizable=no ,modal=yes');


As I said, I'm not 100% certain what the usefulness of this is, as if I want something modal, then that means I need it modal in Firefox and Opera as well as in IE.

Tweet me @kidananubix if you like this post.