Any way to do this: document.getElementsByTagName('head').appendChild('myScript.js'); in NN4?
Apr 6th, 2008 18:51
ha mo, Jean-Bernard Valentaten, Colin Fraser, Mark Filipak,
> While the method is supported in NN6 and IE5.x I doubt it is supported
> in NN4. Many DOM methods are not supported in pre-v6 in NN
Colin is right about that, but there is another possibility. It's a
trick often used when adding banners and ifs-tags in ilayers and so on.
If you don't mind having ugly looking code, you can do the following.
Inside the head-tag, include this:
document.write('<scr' + 'ipt language="JavaScr' + 'ipt"
type="text/javascr' + 'ipt" src="whereeveryourscriptis.js">');
This will add the script to your page. Be careful when using this. every
time the word script is in your text, you need to split it, so that the
browser won't mess up.