Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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.