View Single Post
  #1 (permalink)  
Old June 23rd, 2004, 12:31 PM
fs22 fs22 is offline
Friend of Wrox
Join Date: Apr 2004
Location: Wausau, WI, USA.
Posts: 121
Thanks: 0
Thanked 0 Times in 0 Posts
Default Thoughts on Dynamically assigning external js file


I have a page that assigns an external js file with code like the follow (is a sample):

    switch (optwizsel)
        case "YYP":
            window.document.write("<scr" + "ipt language='JavaScript' src='setup/alerts/alertwizard1.js'></scr" + "ipt>");

So, basically I test several items and attach the js file based upon the test. This job has the potential for doing a lot of tests to attach several extenal js files. Here is my it more efficient to attach one js file and that js file does the testing to attach the appropriate js file and is that even possible?

My code works fine now, but I am concerned about size and speed for the future.

Clay Hess
Clay Hess
Reply With Quote