Tuesday, March 1. 2005
Dynamic loading of external JavaScript (.js) files
Comments
Display comments as
(Linear | Threaded)
I'm trying to do a loading with IE.
but readyState never take "complete" value with DOM method.
So my others scripts hang because the main script is not found.
I've tried with XML approach but I've got a STACK OVERFLOW:0 error.
May you could help me to found a trick ?
[Quote]via DOM loading of script tag Very simple and straight forward[/Quote]
Allready attached js functions on htmlevents; ( EXAMPLE : )
Will not automaticly bind when a dynamic external js loads into the page;
The BODY is allready parsed by your browser, at that time the allready namend functions which require the dynamic js file will be referenced to null;
Any elements which has been created after the load of the js file can bind them :) ( EXAMPLE : obj = document.createElement('DIV'); obj.onclick = isallreadyloaded(); )
Hey, I've build several load script and use IFRAMES in IE to asynchronely load many JS Files and one function that returns true or false when all frames were loaded... Frames were killed at the end of load and everything works fine, but Firefox does not load the frames, it does not load DOM-Script tags, and even document. write does not work like it should, so firefox never loads my js file after body was already executed. So please give me an answer that helps me to get Firefox load a js file when the user presses a button and wait until this is done but without opening a new document in something others than an IFRAME. Please give Sourcecode Thanks
There is a nice solution out there, that might become standard http://www.openjsan.org/doc/c/cw/cwest/JSAN/0.10/lib/JSAN.html
I think it has not yet solved the ActiveX problem of IE, but looks pretty good for all the other open items.
Wolfram
Unfortunately, you can't eval in global scope... :(
Quote from http://nerd.newburyportion.com/2005/09/the-magic-eval
"Thanks to a bug, you won’t be able to iterate global functions using Internet Explorer. Other browsers seem to work fine."
The mentioned setTimeOut didn't work for me. :( As you I simply loading a script which defines a function, and if I call the function _right after_(!) loading the script and it doesn't bring an "Undefined function" error.
What to do? :)
Add Comment
Owner login
