Linking latest Google API files

This forum is for questions about contributing to the project or proposing features that you would like to develop for the project. 

This thread is closed to new posts. You must sign in to post in the forums.
6/8/2009 9:37:37 AM
Gravatar
Total Posts 73

Linking latest Google API files

Not sure if you knew this Joe, or even want to use it, but i just learned from reading this http://code.google.com/apis/ajaxlibs/documentation/ that you can link the latest and greatest jquery ui libs from here :

   <script type="text/javascript" language="javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
   <script type="text/javascript" language="javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js"></script>
   <link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/base/ui.all.css" rel="stylesheet" />
   <link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/smoothness/jquery-ui.css" rel="stylesheet" />

The 1 in the calls is the major of the js version. You can expand it to include the minor and revision as well. As it is, it will request the latest and greatest of the 1.X.X versions. Can also change the theme name to match any of the theme names supported by jquery ui.

At least until it goes to version 2.  It is doing some kind of url rewriting as the .css calls return multiple files, including the images for that theme. I was watching the calls in Fiddler, and it was pretty interesting. The drawback to this, is that there will be multiple calls for these files. The benefit is that you will always have the latest files linked.

 

6/8/2009 9:43:54 AM
Gravatar
Total Posts 18444

Re: Linking latest Google API files

Hi Tim,

Not sure if this is true of the 2.3.0.4.b release of mojoPortal or not, but certainly with the latest svn of mojoportal you can control which version is loaded from web.config/user.config

<add key="GoogleCDNYUIVersion" value="2.6.0" />
<add key="GoogleCDNjQueryVersion" value="1.3.2" />
<add key="GoogleCDNjQueryUIVersion" value="1.7.1" /> 

I generally keep these defaults updated in Web.config as I hear about new releases of those js libraries, but it allows site owners to override it in case they have custom features which require a specific version.

Best,

Joe

6/8/2009 9:49:24 AM
Gravatar
Total Posts 73

Re: Linking latest Google API files

Ah, nice. :)

You must sign in to post in the forums. This thread is closed to new posts.