adding a new Script object runtime

Discussion in 'HTML' started by Lamberti Fabrizio, May 4, 2004.

  1. Hi all,
    I've got this strange problem.

    With JScript code like this window.document.scripts I obtain an array with all scripts defined in my html or asp page.

    At runtime is it possible adding a new element in this array of scripts ?

    If yes how I can do it ?

    Thx at all for the help
    Lamberti Fabrizio, May 4, 2004
    #1
    1. Advertising

  2. Lamberti Fabrizio

    sharon Guest

    one way to do it:

    var script = document.createElement("SCRIPT");
    script.src = "myScript.js";
    document.body.appendChild(script);

    "Lamberti Fabrizio" <> wrote in message news:<c786b4$iuc$>...
    > Hi all,
    > I've got this strange problem.
    >
    > With JScript code like this window.document.scripts I obtain an array
    > with all scripts defined in my html or asp page.
    >
    > At runtime is it possible adding a new element in this array of scripts
    > ?
    >
    > If yes how I can do it ?
    >
    > Thx at all for the help
    > --
    sharon, May 18, 2004
    #2
    1. Advertising

  3. Lamberti Fabrizio

    Jeff Thies Guest

    "sharon" <> wrote in message
    news:...
    > one way to do it:
    >
    > var script = document.createElement("SCRIPT");
    > script.src = "myScript.js";
    > document.body.appendChild(script);



    Does that work in NS7 or Opera? I seem to recall that NS6 had troubles with
    this.

    Jeff

    >
    > "Lamberti Fabrizio" <> wrote in message

    news:<c786b4$iuc$>...
    > > Hi all,
    > > I've got this strange problem.
    > >
    > > With JScript code like this window.document.scripts I obtain an array
    > > with all scripts defined in my html or asp page.
    > >
    > > At runtime is it possible adding a new element in this array of scripts
    > > ?
    > >
    > > If yes how I can do it ?
    > >
    > > Thx at all for the help
    > > --
    Jeff Thies, May 18, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Fernando Rodriguez

    Adding new methods at runtime to a class

    Fernando Rodriguez, Nov 24, 2003, in forum: Python
    Replies:
    1
    Views:
    261
    Peter Otten
    Nov 24, 2003
  2. Delaney, Timothy C (Timothy)

    RE: Adding new methods at runtime to a class

    Delaney, Timothy C (Timothy), Nov 24, 2003, in forum: Python
    Replies:
    5
    Views:
    299
  3. =?iso-8859-1?Q?Fran=E7ois?= Pinard

    Re: Adding new methods at runtime to a class

    =?iso-8859-1?Q?Fran=E7ois?= Pinard, Nov 25, 2003, in forum: Python
    Replies:
    2
    Views:
    332
    Michael Hudson
    Nov 25, 2003
  4. konryd
    Replies:
    2
    Views:
    124
    Ken Bloom
    May 11, 2007
  5. Replies:
    2
    Views:
    407
    Thomas 'PointedEars' Lahn
    Mar 11, 2008
Loading...

Share This Page