Load your JavaScript Frameworks From Google

I don’t know about anybody else but when I’m writing a new Domino application that will have a nice web based UI I will probably add the javascript library and resources that I decide on using into the NSF so that the application will be portable between servers.

If I was working in a fixed environment I could just place the required files directly on the server and I’d know they were there but for something like BlogSphere that anybody can download that’s just impossible to do.

But now there is a new option thanks to Google. They have started hosting a selection of different JavaScript libraries on their servers that anybody can freely reference from within their own applications. They are hosting different versions of the scripts and have vowed to never remove a hosted script from their servers so that it is always available.

One nice thing about hosted script libraries this is that if multiple applications, even if on different servers, are using the libraries then they will be cached in the end users browser, making them load faster for the end user and, of course, taking the traffic hit away from your server.

And it couldn’t be easier to use. Lets say I want to use MooTools V1.1.1 then all I do is add


http://www.google.com/jsapi

If I always want the latest version of the library I can just leave out the version number and the loader will know which one to provide and if I always want the latest in the version 1 codestream I just put a ‘1’ in the version field and it will load in the latest V1.x release.

For more information check out the Google AJAX Libraries API site.

Advertisements
Tagged with:
Posted in Uncategorized
3 comments on “Load your JavaScript Frameworks From Google
  1. Robert says:

    Good stuff ! I just started playing around with DOJO widgets. The toolkit installs everything to the file system either local or on a server. Do you know if they can be loaded to the js library of the NSF instead ?

    thanks

    Like

  2. Jim Roysdon says:

    For development, this is not a bad thing. However, I see SO many issues with this in a production environment. First and foremost is source control and how can the code be tested/validated to not change and break something? Secondly, what if the JS Google hosting server could not be reached? Your page will load, but with all kinds of errors and that would make you look bad. And, there are other reasons to host these on your own server, but those are the highest risks we’ve found.Jim

    Like

Comments are closed.

Archives
%d bloggers like this: