1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Can we include an external js file into another js file?

Discussion in 'JavaScript' started by mahmood, Jan 22, 2007.

  1. #1
    Can we include an external .js file inside another external js file?
    SEMrush
    What do I mean? Lets say I have a file called test.html and I include the following code there:
    Now, can I include or enter my other .js files into mainScript.js file instead of listing them on test.html?
     
    mahmood, Jan 22, 2007 IP
    SEMrush
  2. giraph

    giraph Guest

    Messages:
    484
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Yup, just in mainScript.js put the code...

    document.write("<script src='moreStuff.js' type='text/javascript'></script>");
    Code (markup):
     
    giraph, Jan 22, 2007 IP
    mahmood likes this.