javascript include

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • akg
    New Member
    • Jan 2007
    • 19

    javascript include

    how do I include one javascript file (.js) inside another javascript file ?

    Regards,
    Amit
  • iam_clint
    Recognized Expert Top Contributor
    • Jul 2006
    • 1207

    #2
    <script src="whatever.j s">

    Comment

    • akg
      New Member
      • Jan 2007
      • 19

      #3
      I am using that way only but somehow it looks like embedded javascript file don't get included. any other idea please ?.

      <script src="twiaBase_3 _1.js">

      Amit

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        How about:
        Code:
        document.write('<script src="file2.js"><\/' + script>');

        Comment

        • akg
          New Member
          • Jan 2007
          • 19

          #5
          thank you. it works now.

          Comment

          • iam_clint
            Recognized Expert Top Contributor
            • Jul 2006
            • 1207

            #6
            woohoo :P

            i didn't think about it but your trying to include a javascript file from within another javascript files include? you can do </script><script src="blah.js"></script><script>
            but the other solution is much cooler :P

            Comment

            • acoder
              Recognized Expert MVP
              • Nov 2006
              • 16032

              #7
              Originally posted by akg
              thank you. it works now.
              No problem, you're welcome.

              Comment

              Working...