Firefox script
-
I am using document.scripts[i].src = "TreeClientBehaviour.js" in IE. What is its alternative in firefox.
Bye
The
document.scripts
collection is a non-standard property that doesn't exist in any other browser. What is it that you are trying to accomplish?--- "Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things." -- Douglas Adams
-
I am using document.scripts[i].src = "TreeClientBehaviour.js" in IE. What is its alternative in firefox.
Bye
If you're trying to dynamically run a script, you can do this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>Dynamically Loading JavaScript :: Loading thru Src</title> <script type="text/javascript"> function dynamicLoadJS(scriptName) { var head = document.getElementsByTagName("head")[0]; script = document.createElement('script'); script.id = "DynaScript"; script.type = 'text/javascript'; script.src = scriptName; head.appendChild(script); document.getElementById("LoadJS").disabled="true"; document.getElementById("CallJS").disabled=""; }</script> </head> <body> <button id="LoadJS" onclick="dynamicLoadJS('./onDemandJs.js');">Load JavaScript</button> <button id="CallJS" onclick="showHtml();" disabled="disabled">Call method from new load</button> </body> </html>
Deja View - the feeling that you've seen this post before.