469,328 Members | 1,327 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,328 developers. It's quick & easy.

.hta and .htm: difference

Given the following file:

<html>
<script>
window.showModalDialog =
function(){
alert("showModalDialog called")
};
function doLoad() { showModalDialog(); }
</script>
<body onload="doLoad()" />
</html>

does anyone know why it will alert "showModalDialog called" when saved
as a .htm file, but display a modal dialog when saved as a .hta file
(Microsoft IE specific "HTML applications"). In other words, why can't I
override properties of the global (window) object in HTA ?

Any workarounds and help appreciated,
Alexis

--
Some domain is free
Oct 26 '05 #1
1 2195

"Alexis Nikichine" <al**************@somedomain.fr> wrote in message
news:43***********************@news.free.fr...
Given the following file:

<html>
<script>
window.showModalDialog =
function(){
alert("showModalDialog called")
};
function doLoad() { showModalDialog(); }
</script>
<body onload="doLoad()" />
</html>

does anyone know why it will alert "showModalDialog called" when saved as
a .htm file, but display a modal dialog when saved as a .hta file
(Microsoft IE specific "HTML applications"). In other words, why can't I
override properties of the global (window) object in HTA ?

Any workarounds and help appreciated,


I've not seen this... but I know you can override at least some things (for
example I override window.onerror all the time).

But this is weird - you can do alert(windw.showModalDialog) before and after
the onLoad call and it's the same. But it doesn't WORK the same.

Very strange. If I find anything I'll post, but for now it seems like the
easiest thing is to build a custom dialog library.

Jim Davis
Oct 27 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by guy | last post: by
4 posts views Thread by The Numerator | last post: by
3 posts views Thread by mwhite | last post: by
5 posts views Thread by jonefer | last post: by
41 posts views Thread by Andrew | last post: by
3 posts views Thread by =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?= | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.