Tech Note: JQuery 1.3 Released

Gifts for geeks! A major update for the indispensable Javascript library jQuery has been released into the wild: jQuery 1.3 and the jQuery Foundation. They’re claiming some big speed improvements and other nice enhancements; full details are in the release notes. And they’ve also unveiled a great Ajax-based API browser, setting a new standard for API documentation. Kudos to the jQuery team for some excellent work.

We’ve installed the new version at LGF and had only one problem so far, which is a bit amazing considering that the LGF Blog Engine contains quite a lot of jQuery-based Javascript code and uses half a dozen plugins.

The problem occurred in both Internet Explorer and Firefox 3 (but strangely, not in Safari), and was tracked down to the following code, which refreshes any currently visible “spinoff links” after a successful login:

$('div.related:not(:hidden) input[name=relatedentry]').each(function (i) {
	doRelated($(this).val(), 'show');

The first expression was causing script timeouts in IE and Firefox. The Firebug debugger revealed that jQuery was entering an infinite loop when trying to process the expression, even with no visible spinoff links.

After more experimentation, we concluded that jQuery 1.3 has some bugs lurking in the new implementation of the “:not” selector. In this case there’s a simple fix that doesn’t affect functionality: use the “:visible” selector instead.

$('div.related:visible input[name=relatedentry]').each(function (i) {
	doRelated($(this).val(), 'show');

But in other sections where we really needed the NOT functionality, we had to change the code to use jQuery’s “not” method instead of the selector. For example, this:

$('div.postfooter div.rating a.ratebutton:not(.igray)').click(RateEntry);

…had to be changed to this:

$('div.postfooter div.rating a.ratebutton').not('.igray').click(RateEntry);

After these changes, everything seems groovy in all the major browsers on both Mac and PC. But please let us know if you discover anything that isn’t working right.

Jump to top

Create a PageThis is the LGF Pages posting bookmarklet. To use it, drag this button to your browser's bookmark bar, and title it 'LGF Pages' (or whatever you like). Then browse to a site you want to post, select some text on the page to use for a quote, click the bookmarklet, and the Pages posting window will appear with the title, text, and any embedded video or audio files already filled in, ready to go.
Or... you can just click this button to open the Pages posting window right away.
Last updated: 2021-06-05 2:51 pm PDT
LGF User's Guide RSS Feeds Tweet

Help support Little Green Footballs!

Subscribe now for ad-free access!Register and sign in to a free LGF account before subscribing, and your ad-free access will be automatically enabled.

Donate with
PayPal Shop at amazon
as an LGF Associate!
Recent PagesClick to refresh
Justice Dept Sues Uber for Price Gouging the Disabled With “Wait Times”Justice Department Sues Uber for Overcharging People With Disabilities The Justice Department today filed a lawsuit against Uber Technologies Inc. (Uber) for charging “wait time” fees to passengers who, because of disability, need more time to enter a car. Uber’s ...
1 week, 5 days ago
Views: 1,383 • Comments: 0 • Rating: 1
Tweets: 2 •
Be Alive (Original Song From the Motion Picture ‘King Richard’) Provided to YouTube by Parkwood Entertainment/Columbia Be Alive (Original Song from the Motion Picture "King Richard") · Beyoncé Be Alive (Original Song from the Motion Picture "King Richard") ℗ 2021 Parkwood Entertainment LLC, under exclusive license to Columbia Records, ...
2 weeks, 3 days ago
Views: 1,188 • Comments: 0 • Rating: 0
Tweets: 2 •