The Mighty Blog

Upgrading DotNetNuke to Use jQuery Version 1.4.2

Mar 4

Written by:
3/4/2010  RssIcon

jQuery I didn’t notice it when it happened, but jQuery has had a couple of stabilization releases since the popular 1.4 release.  The updates are pretty significant and I have seen performance increases that were noticeable to the eye with several implementations after upgrading.  I would highly recommend upgrading your current jQuery core scripts if you’re not running version 1.4.2.  Here are some tips for those of you running jQuery in your DotNetNuke® sites.

First of all, as I discussed in this blog before, upgrading the jQuery core script in your DNN site can be as easy as overwriting the existing jQuery file.  Since it was covered there, I won’t go into detail about that again, but I will talk about the current versions.

Aside from the many bug fixes and significant performance enhancements, here are some of the updates that have been made to jQuery since version 1.4:

Even if there weren’t any new features, the benchmarks show that with a 2x improvement in speed since version 1.3.2, your UI enhancements would benefit tremendously.

You can tell which version of jQuery you’re running by looking at your Host Settings page.  Find it near the bottom of the Advanced Settings section.

Host Settings > Advanced Settings > jQuery Settings

You can upgrade the DNN jQuery file by following the advice in my earlier blog post.  However, what if you’re using the Google hosted version?  It is not very clear how to upgrade that, although it could be figured out.  Unfortunately, DNN Corp is not updating that setting even when they upgrade the jQuery version included with DNN.  By default, the hosted URL is:

http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js

If you want to upgrade to the newest hosted version, just change it to the following, and check the “Use Hosted jQuery Version” checkbox.

http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js

Click the Update link at the bottom of the page, and you’re running the newest jQuery version.  Congrats!

Technorati Tags: ,,,

Tags:
Categories: DotNetNuke

11 comment(s) so far...


Gravatar

Re: Upgrading DotNetNuke to Use jQuery Version 1.4.2

Thanks Will,

Very simple to do, but takes the uncertainty out of it.

By Ralph Williams on   3/4/2010
Gravatar

Re: Upgrading DotNetNuke to Use jQuery Version 1.4.2

Thanks Will,

I've just done it.

By Rexha on   3/4/2010
Gravatar

Re: Upgrading DotNetNuke to Use jQuery Version 1.4.2

You're both very welcome! :)

By Will on   3/4/2010
Gravatar

Re: Upgrading DotNetNuke to Use jQuery Version 1.4.2

Will, are you sure that the change to the hosted version is necessary? I was of the impression that it went by the most significant digit. ie. 1.4 will grab the latest version that started with 1.4 and using just 1 would get the newest up to but not including 2?

By Bill Mason on   3/5/2010
Gravatar

Re: Upgrading DotNetNuke to Use jQuery Version 1.4.2

@Bill You may be right. I haven't seen any documentation on that though. I cannot find that information anywhere on their API site.

By Will on   3/5/2010
Gravatar

Re: Upgrading DotNetNuke to Use jQuery Version 1.4.2

I knew I had read this somewhere. I am currently reading "Jquery, Novice to Ninja" and this excert is from the book.

Obtaining the Latest Version with Google CDN
If you look closely at the URL pointing to Google’s servers, you’ll see that the version of jQuery is specified by one of the path elements (the 1.4.0 in our example). If you like using the latest and greatest, however, you can remove a number from the end of the version string (for example, 1.4) and it will return the latest release available in the 1.4 series (1.4.1, 1.4.2, and so on). You can even take it up to the whole number (1), in which case Google will give you the latest version even when jQuery 1.5 and beyond are released!
Be careful though: there’ll be no need to update your HTML files when a new version of jQuery is released, but it will be necessary to look out for any library changes that might affect your existing functionality.

By Bill Mason on   3/5/2010
Gravatar

Re: Upgrading DotNetNuke to Use jQuery Version 1.4.2

@Bill Interesting. I wonder why Google hasn't documented this in their API site though. Does the book detail the inclusion of jQuery using the Google Load methods, or through the URL like shown here?

Overall, I think this is a really cool thing if it's true. Hopefully I can find some time to check it out. :) However, I would caution against it and suggest that everyone continue to manually upgrade.

A prime example would be the changes in the jQuery core from 1.3.x to 1.4. In this case, many people's jQuery code might break when not using $(document).method vs. $.method. In this instance, you would have no idea that your code and site broke until you come across it, or someone tells you. Hopefully, it's not a a paying client that tells you about it. :)

By Will on   3/5/2010
Gravatar

Re: Upgrading DotNetNuke to Use jQuery Version 1.4.2

Will,

It describes this in the section on "Versioning".

http://code.google.com/apis/ajaxlibs/documentation

I agree with you about using a specific version but by the way DNN is using it, it looks like they will always be getting the newest version?

Bill

By Bill Mason on   3/5/2010
Gravatar

Re: Upgrading DotNetNuke to Use jQuery Version 1.4.2

@Bill: Beautiful! Thanks for posting that link. It appears that Google is indeed doing that. I am going to stand by my practice of specifying specific versions for the reasons I gave above, but it's good to know that they are doing this. :)

For the performance reasons that are outlined in this great blog post about Google's hosted code solution on encosia (see the "Implementation" section), you should always load jQuery by referencing the URL, and not the load method in Google's API.

Thanks again for clearing this up and saving me time, Bill. You're awesome! :)

By Will on   3/5/2010
Gravatar

Re: Upgrading DotNetNuke to Use jQuery Version 1.4.2

@Will - I was very intentional when crafting the jQuery CDN link to leave it as a floating link. You can certainly change it to be more specific, but I really had hoped to avoid blog posts like this one ;) Oh, and for those of you who hate to change core files (which includes jQuery) there is a 3rd way to update jQuery - upgrade to the new 5.3.0 version which is due out next week.

By Joe Brinkman on   3/12/2010
Gravatar

Re: Upgrading DotNetNuke to Use jQuery Version 1.4.2

@Joe As the comments above show, I was not originally aware of the automated versioning of the Google hosted service. However, my concern with not specifying a specific version is the potential conflict. For example, breaking changes or bug fixes that break client code on the DNN site. We wouldn't find out about the breakage until someone told us, as we wouldn't have done any QA on the version update against our code base.

On a side note, I am going to have to find another subject to annoy you now! ;)

By Will on   3/12/2010

Your name:
Gravatar Preview
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Add Comment   Cancel 
Add to Technorati Favorites
Tweet about my blog
The opinions expressed here are the personal opinions of Will Strohl and do not necessarily represent the views and opinions of the DotNetNuke Corporation.
© Copyright 2004-2011 by Will Strohl. All rights reserved. Website Skinned By: Ralph Williams  Website Hosted By: Applied Innovations