adding a new Script object runtime

  • Thread starter Lamberti Fabrizio
  • Start date
L

Lamberti Fabrizio

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
 
S

sharon

one way to do it:

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

Jeff Thies

sharon said:
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
 

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
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top