SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    Non-Member
    Join Date
    Jun 2007
    Posts
    254
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    External JavaScript File

    Hi Folks,

    How do I put JavaScript in an external file, and then link to it from another file?

  2. #2
    SitePoint Enthusiast
    Join Date
    Jul 2006
    Location
    Leeds, UK
    Posts
    38
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    HTML => JS is

    <script type="text/javascript" src="YOUR_FILE.js"></script>

    Although this is actually right too, this won't work (XHTML);

    <script type="text/javascript" src="FILE.js" />


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •