Tech Note: JQuery 1.3 Released

Science • Views: 1,850

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: 2023-04-04 11:11 am PDT
LGF User's Guide RSS Feeds

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
Cash.app
Recent PagesClick to refresh
The Pandemic Cost 7 Million Lives, but Talks to Prevent a Repeat Stall In late 2021, as the world reeled from the arrival of the highly contagious omicron variant of the coronavirus, representatives of almost 200 countries met - some online, some in-person in Geneva - hoping to forestall a future worldwide ...
Cheechako
2 days ago
Views: 91 • Comments: 0 • Rating: 1
Texas County at Center of Border Fight Is Overwhelmed by Migrant Deaths EAGLE PASS, Tex. - The undertaker lighted a cigarette and held it between his latex-gloved fingers as he stood over the bloated body bag lying in the bed of his battered pickup truck. The woman had been fished out ...
Cheechako
2 weeks ago
Views: 259 • Comments: 0 • Rating: 1