Including .js file into another .js file? - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Including .js file into another .js file?

MoeeN AhmaDMoeeN AhmaD Posts: 3Member
Can anyone help me out in including a js file in another js file. I have a js file that is already included in my whole site, now i would like to add 1 more js file into my site, what could be the solution?

Comments

  • zibadianzibadian Posts: 6,349Member
    : Can anyone help me out in including a js file in another js file. I have a js file that is already included in my whole site, now i would like to add 1 more js file into my site, what could be the solution?
    :
    All external files, which are included in the same html file using the tag, can make use of one and another. Thus:
    [code]


    [/code]
    functions in two.js can call functions defined in one.js, and vice versa.
  • MoeeN AhmaDMoeeN AhmaD Posts: 3Member
    : : Can anyone help me out in including a js file in another js file. I have a js file that is already included in my whole site, now i would like to add 1 more js file into my site, what could be the solution?
    : :
    : All external files, which are included in the same html file using the tag, can make use of one and another. Thus:
    : [code]
    :
    :
    : [/code]
    : functions in two.js can call functions defined in one.js, and vice versa.
    :

    ThanX but i wana include "two.js" in "one.js", coz i have many files in my website, i cant edit all these, so i think the better way will be to include it in "one.js". Hope i'll get what i want!

  • zibadianzibadian Posts: 6,349Member
    : : : Can anyone help me out in including a js file in another js file. I have a js file that is already included in my whole site, now i would like to add 1 more js file into my site, what could be the solution?
    : : :
    : : All external files, which are included in the same html file using the tag, can make use of one and another. Thus:
    : : [code]
    : :
    : :
    : : [/code]
    : : functions in two.js can call functions defined in one.js, and vice versa.
    : :
    :
    : ThanX but i wana include "two.js" in "one.js", coz i have many files in my website, i cant edit all these, so i think the better way will be to include it in "one.js". Hope i'll get what i want!
    :
    :
    As far as I know, that's impossible. But perhaps you can find more info on www.w3schools.com.
  • aaronjones3593aaronjones3593 Posts: 122Member
    : : : : Can anyone help me out in including a js file in another js file. I have a js file that is already included in my whole site, now i would like to add 1 more js file into my site, what could be the solution?
    : : : :
    : : : All external files, which are included in the same html file using the tag, can make use of one and another. Thus:
    : : : [code]
    : : :
    : : :
    : : : [/code]
    : : : functions in two.js can call functions defined in one.js, and vice versa.
    : : :
    : :
    : : ThanX but i wana include "two.js" in "one.js", coz i have many files in my website, i cant edit all these, so i think the better way will be to include it in "one.js". Hope i'll get what i want!
    : :
    : :
    : As far as I know, that's impossible. But perhaps you can find more info on www.w3schools.com.
    :
    He's right; It's not possile for JavaScript to include another JS file like ASP can. You will have to have a search and replace for your pages in NotePad or something similar...

    Search for:
    Replace with:

    Sorry,


    -( Aaron )-

    "Alcohol aint the answer, but atleast you forget the question"

Sign In or Register to comment.