469,922 Members | 2,106 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

Dynamic load of js script failure in IE 6

rh
Executing the script given below Opera, Netscape and Mozilla
successfully load the js file in both the "main" and "test" window.
However, while IE 6 manages to load OK in "main", it produces the
"Load failed in test" alert.

IE behaviour is the same if a local file is used for the js source, so
the problem doesn't appear to be zone security related.

Any ideas of what's wrong here, or what needs to be done to get it to
work in IE?

Thanks,

../rh

<html>
<head>
<script type="text/javascript"
src="http://www3.telus.net/rhall/testLoad.js"></script>
<script>
self.name = "main";
if (typeof myFunc != "undefined") alert("Loaded OK in "+self.name);
else alert("Load failed in "+self.name);

var win = window.open("","test");
win.document.open();
win.document.write(
'<html>\n'
+ '<body>\n'
+ '<script type="text/javascript"
src="http://www3.telus.net/rhall/testLoad.js"> <\/script>\n'
+ '<script>\n'
+ ' if (typeof myFunc != "undefined") alert("Loaded OK in
"+self.name);\n'
+ ' else alert("Load failed in "+self.name);\n'
+ '<\/script>\n'
+ '</body>\n'
+ '</html>\n'
);
win.document.close();
</script>
</head>
<body>
</body>
</html>
Jul 20 '05 #1
1 4179
rh
co********@yahoo.ca (rh) wrote in message news:<29**************************@posting.google. com>...
Any ideas of what's wrong here, or what needs to be done to get it to
work in IE?


It turns out on further testing, the load of the js file actually
occurs in the "test" window in IE 6. But the loading is being done
asynchronously, and is not completed at the time the test for the
function presence is carried out. That's not supposed to happen
(unless there's a defer), right?
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

13 posts views Thread by mr_burns | last post: by
4 posts views Thread by Daniel Keller | last post: by
9 posts views Thread by pbd22 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.