Remote assets in websites
<!-- Grab Google CDNs jQuery, with a protocol relative URL; fall back to local if necessary --> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.js"></script> <script>window.jQuery || document.write("<script src='js/libs/jquery-1.5.1.min.js'>x3C/script>")</script>
This great piece of code allows you to include the jquery script via the Google URL and if for some reason it isn’t accessible it will fallback to a local version. Not only does this remove the one worry i ever had with linking to external files but the comment with this made me face palm in recognition of why people do this in the first place. Those three magic letters CDN. A CDN is a content delivery network and is used to serve up files to users by serving them from locations closest to the user. So not only are we taking a small piece of bandwidth of our shoulders and placing it upon the mighty shoulders of the Google infrastructure we are also increasing the speed that the file is going to be downloaded for users across the world. I know I’ll be using it from now on, will you?