Monday, September 14, 2009

GoogleAJAXLibrariesAPI

Since over a year Google Code is hosting a set of clientside libraries under the name Google AJAX Libraries API. For easy usage in Sharepoint (WSS3 / Moss2007) i´ve wrapped the API's into seperate SiteCollection Features.



For the features to work, the Masterpages must be prepped by adding the following DelegateControl to the head:



When all Features of this Solution are activated, the following script will be rendered in the head:


The sourcecode and the package of the Solution can be downloaded from here. The solution is built using Visual Studio 2008 and WSPBuilder.
Because the scripts are loaded from the Google-servers, websites running under HTTPS might display clientside warnings to the visitor.
At this moment i've selected versions by a general string, as this would enable minor updates of the libraries to automatically be used. Selecting a specific version of a library is easy by changing the version-string in the elements.xml-files.

2 comments:

  1. Great solution! :-)

    Can I give the suggestion to change all the language="javascript" attributes to type="text/javascript". Otherwise your page isn't xhtml compliant.

    ReplyDelete
  2. @Danny: Thanks! You are correct. I've updated the solution to render xhtml compliant javascript code.

    ReplyDelete