Web Analytics Made Easy -
StatCounter How does a "js" file load from the Internet - CodingForum


No announcement yet.

How does a "js" file load from the Internet

  • Filter
  • Time
  • Show
Clear All
new posts

  • How does a "js" file load from the Internet

    I am building a menu bar with a progarm called Menu Maker from Xara.com. Basically, it creates a menu bar as a animated gif file and then puts the coding for the menu in a "js" file. As a result, the gif file is about 6k. Although the gif file is small, the "js" file is 33k (this is because my menu is very comprehensive).

    Here's my question. When a person FIRST visits my website, how is the "js" file loaded? Obviously, the 6k gif files is loaded from the server down to the person's computer. However, is the 33k "js" file also downloaded to the person's computer or does the "js" file stay on the server and is executed there? Obviously, if the "js" file is downloaded, that will really slow down the initial visit to my website.

    Thanks for any insight you can give me.

  • #2
    It is downloaded and executed on the client, if you're talking clientside JavaScript (as differentiated from Netscape's serverside JavaScript or Microsoft's ASP using JScript).
    liorean <[[email protected]]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards