Making a script tag in IE and NN

G

gsb

I am trying to create a script tag:
script = document.createElement('script');
....and assign its script (IE) :
script.txt = " ...my script... ";

But this does not work in NN.

Any help?
Where to find online documentation on 'Script Tag'?

Thanks,

gsb
 
B

Brian Genisio

gsb said:
I am trying to create a script tag:
script = document.createElement('script');
...and assign its script (IE) :
script.txt = " ...my script... ";

But this does not work in NN.

Any help?
Where to find online documentation on 'Script Tag'?

Thanks,

gsb

This could be tough to find a cross-browser solution. What version of
NN are you trying for? The script.text member is supposed to exist in
NN, but be read only. Also, it's use is goofy, and not known to
actually work the way you want in IE5. Your solution is different,
because you are creating it dynamically.

You _could_ use eval() or execScript() (IE only), but I suppose the
proper way to answer this question is:

What are you trying to do? It seems that there is probably a better
solution to your problem than dynamically creating a new SCRIPT node.

Brian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,077
Messages
2,570,567
Members
47,202
Latest member
misc.

Latest Threads

Top