Content Delivery Networks for you javascripts
Content Delivery Network - CDN

A content delivery network(CDN), is defined as "a large distributed system of servers in multiple data centers in the internet. The goal of a CDN is to server content to endusers with high avalibility and high performance."(wikipedia). The general idea is that you can put your resource files on a CDN server in Denmark, and the system will automaticaly reproduce the images to all of its other CDN servers. I.e. when a user from Australia wants to get the image resources, instead of requesting them from Denmark, hell just request them from the CDN server, thats located in Australia. The system will figure out, which server is closes to the user, and server the file from that server, saving alot of time over the wire, for long connections.

Javascript on CDNs

Two of the largest players on the CDN scene is Microsoft and Google, and they have both implemented some of the most popular javascript frameworks on their servers. The point is that they host the javascript files that the frameworks consists of, and you as a developer should just reference the framework on their server.

What itll do it that itll find the file on the server closest to you, and give your browser that version, the advantage is that you might already have visited a site, that had the same reference, and therefore your browser already have the file cached, and you dont have yo download the file. For many Javascript frameworks, this could mean alot less data should be transmitted, befor your page can be rendered.

What can i find on CDNs

The best example is jQuery which can be found on both Microsoft and Google CDN, but other include, JQuery UI, Modernizr, Knockout JS, Prototype, SWFObject ect. for a full list see:

When utilizing a CDN, you simply reference your script direct from the server like this:

<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.2.min.js"></script>

CDN's are perfect for your public webs, but when using them on a local intranet, you shuld always have a fallback mechanism to a local version of the file, as you cant be 100% sure that the clients have access to the CDN urls.