Making a script tag in IE and NN

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • gsb

    Making a script tag in IE and NN

    I am trying to create a script tag:
    script = document.create Element('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


  • Brian Genisio

    #2
    Re: Making a script tag in IE and NN

    gsb wrote:
    [color=blue]
    > I am trying to create a script tag:
    > script = document.create Element('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
    >
    >[/color]

    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

    Comment

    Working...