S
sfeher
Hi,
Is there a way to know when a function is available for me to call it
from a dynamically loaded a javascript?
I use this code to load the include.js file and then I call
testIncludeFn() from it:
<code>
var html_doc = document.getElementsByTagName('head').item(0);
var file = document.createElement('script');
file.setAttribute('language','javascript');
file.setAttribute('type','text/javascript');
file.setAttribute('src','/include.js');
html_doc.appendChild(file);
// here I would like to be able to wait for the script to become
available
testIncludeFn();
</code>
It works in IE and sometimes I get it to work in FF 1.5, but I would
like to have a way of reliably calling testIncludeFn().
Can I pool somehow the DOM to see if the load completed. How?
Is there a better approach to it?
Regards,
Sebastian
Is there a way to know when a function is available for me to call it
from a dynamically loaded a javascript?
I use this code to load the include.js file and then I call
testIncludeFn() from it:
<code>
var html_doc = document.getElementsByTagName('head').item(0);
var file = document.createElement('script');
file.setAttribute('language','javascript');
file.setAttribute('type','text/javascript');
file.setAttribute('src','/include.js');
html_doc.appendChild(file);
// here I would like to be able to wait for the script to become
available
testIncludeFn();
</code>
It works in IE and sometimes I get it to work in FF 1.5, but I would
like to have a way of reliably calling testIncludeFn().
Can I pool somehow the DOM to see if the load completed. How?
Is there a better approach to it?
Regards,
Sebastian