This Week in jQuery, vol. 8

Posted on by

Another week, another collection of links to some of the most interesting and exciting new jQuery happenings around the web.

If you have ever used a regular expression tool to highlight character matches in real time, then you’ll jump for joy when I tell you about the Interactive jQuery selector tester written by Samuli Kärkkäinen. You enter a selector expression, and in real time you get to see the elements in the DOM structure that have been selected. I can see this being very handy for complex expressions or for optimizing expressions down to the simplest solution.

Also, in case you didn’t notice, the second maintenance release for jQuery UI 1.7 is out.

Articles this Week

Tutorials this Week

Plugins this Week

  • A new jQuery mp3 player hit the streets, jPlayer! It’s also Themeroller ready!
  • Need to re-skin the browser default UI forms? Check out the uniform jQuery plugin. It might just help you realize the dream of making web forms look the same across all browsers.
  • If your cup of tea is dealing with mouse gestures, then you’ll be glad to know that there is now a SUPER Gestures plugin. Its SUPER!
  • SWFUpload + jQuery = SWFUpload jQuery Plugin.

Plugin Spotlight/Updates

Pulled from my own personal archives. I bring you $.event.special.hover which is an alternative to Brain Cherne’s popular hoverIntent plugin. You may or may not have missed this plugin, but regardless, it’s certainly worth a first look, or second.

What’s a week of jQuery news without a lightbox thickbox super window modal dialog thingy kabob doodad solution?

SuperBox and jOverlay, welcome to the crowd! Nice to have you.

jQuery Gossip/Rumor Mill

It’s possible that you might be seeing several team members, if not John Resig himself, talking at the up and coming devdays. And the really juicy part is they might be wearing a DEVO red energy dome.

jQuery Quote of the Week

“You can save a tremendous amount of time and effort by using the browser-independent framework that JQuery has spent untold man-hours testing, debugging, and proving in the field. While there’s nothing wrong with writing JavaScript, why not speed your development time by writing to the library instead? As I’ve always said, don’t reinvent the wheel, unless you plan on learning more about wheels. ” – Jeff Atwood

This Week in jQuery, vol. 7

Posted on by

After a long hiatus, I’m happy to present another roundup of jQuery happenings. Keep in mind that this is just a small, fairly random sampling of what has been going on. For more frequent news and announcements, be sure to follow @jquery on Twitter.

jQuery Updates

Brandon Aaron has been writing a series called “jQuery Edge” on his blog, detailing some of the cool enhancements in store for the next version of jQuery. His most recent, New Special Event Hooks, describes the four “hooks” that make up the new custom event API: setup, teardown, add, and remove. It’s a must-read for anyone working with event-driven jQuery scripts.

Plugins

Ben Alman describes his jQuery iff plugin: a chainable “if” statement.

Pete Higgins of Dojo fame has written a jQuery pub/sub plugin, “loosely based on the Dojo publish/subscribe API.” His plugin joins other publish/subscribe plugins such as Fling and jQuery Subscribe/Publish.

Paul Irish has ported a YUI3 script to jQuery for his idleTimer plugin. The plugin detects when a user has become idle.

Jonathan Sharp released an XMLDom plugin, which “takes a string of XML and converts it into an XML DOM object for use with jQuery.”

Tutorials

Janko Jovanovic explains his proof-of-concept for Advanced docking using jQuery

Azam Sharp examines Unit Testing JavaScript Using JQuery QUnit.

Andy Matthews begins a screencast series on jQuery and Air. His first post explores creating a new AIR project in Aptana.

Interviews

In an audio interview, Nathan Smith and Matt Vasquez discuss their use of jQuery.

Drew Douglass interviewed me recently for Nettuts.

Miscellaneous

A new site, jQuery List assembles a list of links to an enormous number of jQuery plugins and code examples on a single page.

This Week in jQuery, vol. 6

Posted on by

Another week, another collection of links to some of the most interesting and exciting new jQuery happenings around the web.

One of the most interesting happenings this week was the release of Glimmer. Glimmer allows you to easily create interactive elements on your web pages by harnessing the power of the jQuery library. Without having to hand-craft your JavaScript code, you can use Glimmer’s wizards to generate jQuery scripts for common interactive scenarios. Glimmer also has an advanced mode, providing a design surface for creating jQuery effects based on your existing HTML and CSS.

Also worth mentioning is the great new facelift given to the jQuery for Designers site from Remy Sharp.

And if you haven’t notice Wrox has released a new book, Beginning JavaScript and CSS Development with jQuery. A review of the book is forthcoming.

Articles this Week

Tutorials this Week

Plugins this Week

Plugin Spotlight

Pulled from my own personal archives. I bring you, the Query ListNav Plugin from iHwy, Inc.. You may or may not have missed this plugin, but regardless, it’s certainly worth a first look, or second.

Tools Released this Week

Howie Weiner, in addition to his 960.gs grid overlay plugin, is now providing a bookmarklet version.

And the typical “Best of…” from this week

jQuery Gossip/Rumor Mill

Word on the street is that O’Reilly has in the works a jQuery cookbook authored and edited by several core team members. Additionally, I’m hearing whispers of another cookbook specifically tailored for jQuery Designers.

And remember, for up to the minute jQuery happenings, you can follow the official jQuery twitter profiles jquery, jqueryui, and jquerysites. Also, don’t be afraid to contact us (thisweekinjquery (at) gmail.com) if you feel we missed any noteworthy information or would like to submit noteworthy happenings for next week.

This Week in jQuery, vol. 5

Posted on by

Sorry about the unplanned hiatus last week. Not sure how long I’m going to be able to sustain this, but here we go again with another weekly roundup of jQuery news…

jQuery + Server-Side Solutions

A common complaint in the earlier days of jQuery was that there wasn’t enough information on how to integrate jQuery with server-side languages (or frameworks), so it’s nice to see a proliferation of tutorials in this area. Here are a few of the recent ones:

Plugins

Fun Stuff

Chris Barr used jQuery to create a fun little game, Guessr: Guess the Flickr Tag, which also takes advantage of the jQuery UI ThemeRoller.

Don’t forget to check out This Week in jQuery UI, vol. 6.

This Week in jQuery, vol. 4

Posted on by

Here again is my somewhat arbitrary list of jQuery-related sightings on the web this week.

Featured jQuery App

The folks at Carsonified have just released a beta of Twiggy, an app that searches Twitter from Nokia’s widget-enabled phones Opera as a widget. Widget apps are built in HTML, CSS and Javascript, and are stored and executed locally. Twiggy lets you search Twitter and save favorites.
Elliott Kember, who along with Mike Kus is responsible for creating Twiggy, describes their use of jQuery in the app:

Twiggy uses jQuery for all the Javascript animations and layout changes. There are a few small widget-only APIs that interface with the phone, but I’ve used jQuery for the user interaction bits. I didn’t end up using anything very complex or tricky due to the limited time frame, but I found that the phone handled animations really well. It’d be very interesting to design a much bigger app and take the phone to its limits.

I used a Twitter jQuery plugin from http://tweet.seaofclouds.com/ and it worked just fine. I didn’t use jQuery UI – but I’d be interested to see whether it worked on such a limited platform.

I chose to use jQuery because it’s familiar, reliable and fast. I didn’t want to use custom little libraries and functions which might not work so well. I was really pleased to find that the N96, for one, runs jQuery really well in this runtime. I half-expected the rendering engine to be slow, or buggy, and shoe-horned into the phone somehow, but it’s quite happily running a full, packed jQuery 1.3.2.

Upcoming Conference

jQuery Project Team members Yehuda Katz and Brandon Aaron will be presenting jQuery on Rails on May 4 at RailsConf 2009 in Las Vegas.

jQuery Game

A brand new game, jQuery Blackjack is now available on a brand new site, jQuery Love. The game uses jQuery, jQuery UI, and a ThemeRoller theme.

Tutorials and Blog Entries

Plugins

Don’t forget to check out This Week in jQuery UI.

This Week in jQuery, vol. 3

Posted on by

Another week, another collection of links to some of the most interesting and exciting new jQuery happenings around the web.

Plugins

  • Jörn Zaefferer’s wildly popular Validation plugin just got updated to version 1.5.2, which includes a slick demo of the plugin’s integration with jQuery UI Tabs.
  • DataTables: uses “progressive enhancement” to convert a static HTML table into a much more dynamic data table.
  • UI.Layout: allows you to “create any UI look you want – from simple headers or sidebars, to a complex application with toolbars, menus, help-panels, status bars, sub-forms.” While not a part of the jQuery UI project, you can combine it with jQuery UI widgets “to create a sophisticated application.”

Tutorials and Blog Entries

A number of tutorials for incorporating jQuery with Microsoft tools have been written recently:

jQuery Training

The folks at Collective Idea have announced a three-day jQuery training course in Holland, Michigan, May 13-15. I’ll be leading the training.

Fun Experiment

Kelvin Luck has put together a really cool proof of concept using jQuery/JavaScript. He calls it boingPic and describes it as “a simple experiment using javascript and jQuery which allows you to make an image of your choice all boingy.”

Find out what has happened this week in jQuery UI

This Week in jQuery, vol. 2

Posted on by

A lot has happened this week in jQueryland. Here are a few highlights:

jQuery Core Development

Brandon Aaron has been on a roll the past few days, fixing bugs and enhancing features for the next version of jQuery. Among the updates committed to the Subversion repository were better support for nested fixed position elements and added support for contexts other than document with the .live() and .die() event delegation methods. See the past week’s timeline here.

Plugins

  • A new release of Haineault’s Timepickr plugin is available.
  • Diego A. has updated his Star Rating plugin.
  • Jason Frame put together a set of “fun little text effects.”
  • The new Flexbox acts as a “replacement for html textboxes and dropdowns, using ajax to retrieve and bind JSON data.”
  • Not really a plugin, Sunday Morning is a fun jQuery-based translation bookmarklet using the Google Translate API.

Tutorials and Blog Entries

Free Book Chapter

Packt Publishing has posted a sample chapter of the new Learning jQuery 1.3 book. You can download the free PDF.

Don’t forget to check out This Week in jQuery UI

This Week in jQuery, vol. 1

Posted on by

This is the first in what we’re hoping to be a weekly series of blog posts about what is going on in the world of jQuery. We’ll take a look at new or updated plugins, recent tutorials, and other jQuery-related news.

Book

Learning jQuery 1.3

Jonathan Chaffer and I (Karl Swedberg) just had our book Learning jQuery 1.3 published by Packt Publishing. It’s an update of the popular Learning jQuery book, which was released nearly two years ago. The new one features additions to the library (event namespacing, JSONP, new effects methods, etc.) introduced since the release of the first book, improved and extended examples, expanded plugins chapters, and a quick reference to all methods and selectors. It’s available on the Packt website and on amazon.com.
Continue reading

jQuery UI 1.7 Released: New domain, New CSS Framework & Dramatic Updates to Controls

Posted on by

We’re excited to announce the release of jQuery UI v1.7, the newest version of jQuery’s effects and UI library. This release culminates many months of development in which a major overhaul of the whole library was performed and a new CSS framework introduced, all in order to provide a professional and easily extensible set of UI controls and effects for jQuery developers. The new CSS framework is especially exciting since it will not only allow for easy theming of jQuery UI controls but also allow plugin authors in general to take advantage of ThemeRoller, the dynamic theme generation application developed by the Filament Group for the jQuery UI project.

Full details of this new & exciting release can be found on the new jQuery UI blog.

jQuery 1.3.2 released

Posted on by

Downloading

jQuery 1.3.2:
http://code.jquery.com/jquery-1.3.2.min.js minified (19kb with Gzipping)
http://code.jquery.com/jquery-1.3.2.js regular (120kb)

Changes

Elements Returned in Document Order

This is a change to jQuery’s selector engine that re-orders the returned results to be in document order, instead of the order in which the selectors were passed in. This change was done in order to be in compliance with the Selectors API specification (which jQuery uses, internally, in browsers that support it).

A sample result:

  // jQuery 1.3.1 (and older)
  $("h1, h2, h3")
  => [ h1, h1, h2, h2, h3, h3 ]

  // jQuery 1.3.2
  $("h1, h2, h3")
  => [ h1, h2, h3, h3, h1, h2 ]

I’d like to thank Diego Perini for pushing us to get this implemented.

.live() Can Now Prevent Bubbling

It’s now possible to call event.stopPropagation() or return false within a callback and have it stop the bubbling of the live event. This means that you can now bind live events inside each other and have the inner handlers prevent the outer handlers from firing.

For example:

  <ul>
    <li><b>Google</b></li>
    <li><b>Yahoo</b></li>
  </ul>
  <script>
    $("li").live("click", function(){
      $(this).addClass("active");
    });
    $("li b").live("click", function(){
      $(this).addClass("active");
      return false;
    });
  </script>

I’d like to thank Iraê for the solution that he proposed for this problem.

For those wondering about the, currently missing, features of .live() (like submit and change events) you can expect all of those to land in jQuery 1.3.3, due to arrive sometime next month.

:visible/:hidden Overhauled

We’ve changed the logic behind the :visible and :hidden selectors (which were used throughout jQuery to determine the visibility of an element).

This is how the logic has changed:
* In jQuery 1.3.1 (and older) an element was visible if its CSS “display” was not “none”, its CSS “visibility” was not “hidden”, and its type (if it was an input) was not “hidden”.
* In jQuery 1.3.2 an element is visible if its browser-reported offsetWidth or offsetHeight is greater than 0.

What does this change mean? It means that if your element’s CSS display is “none”, or any of its parent/ancestor element’s display is “none”, or if the element’s width is 0 and the element’s height is 0 then an element will be reported as hidden.

What is the benefit of making this switch? The result is two-fold:
* The performance is much, much, better. (See below.)
* An element is reported as “hidden” if it’s inside a “hidden” element (something that wasn’t possible before, without the use of a plugin.

I’d like to thank Matheus Almeida for proposing some of the changes that were implemented to improve the performance of these selectors.

.height()/.width() Overhauled

The width and height related selectors have all been overhauled – dramatically improving their speed in all browsers.

I’d like to thank Mike Helgeson for his contributions here which were largely responsible for some of the massive gains that we’re seeing in these methods.

Selector Speed-up in IE

The benefits of the new Sizzle selector engine are really starting to come to light as contributions from the larger JavaScript community come in. A number of additions have landed that have helped to improve the performance of the engine – especially in Internet Explorer.

I’d like to thank Fabio Buffoni for his contributions here which were largely responsible for these speed-ups.

.appendTo()/etc. Now Return Inserted Elements

This is a (minor) API change – resolving a bug in the jQuery API. The methods appendTo, prependTo, insertBefore, insertAfter, and replaceAll all now return the set of inserted elements, instead of the original set of elements.

To understand this change we need to look at a simple example.

Given the following markup, in jQuery 1.3.1 (and older) the following would occur:

  <div></div>
  <div></div>
  <script>
  $("<p/>")
    .appendTo("div")
    .addClass("test");
  </script>

The result in 1.3.1 (and older):

  <div><p class="test"></p></div>
  <div><p></p></div>

This was due to the fact that .appendTo, etc. would only return the elements that were passed in to it, instead of the elements that were actually inserted (and since only a single paragraph was passed in – the first one to be inserted – only the first paragraph had the class added to it).

Thus, if you were to run the same code in jQuery 1.3.2 you would end up with:

<div><p class=”test”></p></div>
<div><p class=”test”></p></div>

Which is the expected result. The only catch is that appendTo, prependTo, insertBefore, insertAfter, and replaceAll all now push onto the jQuery stack (meaning that they’re affected by .end().

We did a survey of existing uses of the above methods and could find no cases where this change would affect any existing code, so we felt safe going ahead with it (especially considering that it’s the expected behavior, to begin with).

Testing

We have a couple announcements with regard to our test suite and our testing methodology in the jQuery project.
* We are now fully supporting, and the test suite is completely passing in, Internet Explorer 8rc1 and Chrome 2 (Nightly) (in addition to our normal selection of browsers).
* The test suite has broken 1500 tests (1504, to be precise).

This means that we now actively test in – and pass the test suite in – 11 browsers: Chrome 1, Chrome Nightly, IE 6, IE 7, IE 8rc1, Opera 9.6, Safari 3.2, WebKit Nightly, Firefox 2, Firefox 3, Firefox Nightly.

(We’re waiting for the next beta of Opera 10 before we begin to support it fully, there are some critical problems with the current beta.)

To measure the performance of different portions of jQuery we used a modified copy of the SlickSpeed test suite to run our tests (adapted to handle non-selector tests). The raw results for the test runs can be found below (all times in milliseconds).

Selector Tests

We used a copy of the Yahoo home page (a representatively complex web page) and used a selection of selectors that people actually use. Targeting selectors that people currently use will help to improve the performance of both existing and future applications.

Frameworks	jQuery 1.2.6	jQuery 1.3	jQuery 1.3.2
IE 6		1059		799		626

:hidden/:visible Tests

We tested both the :hidden and :visible selectors on a number of elements in our test page.

Frameworks	jQuery 1.3	jQuery 1.3.2
Firefox 3	1512		190
Firefox 3.1	1202		161
Safari 3.2	592		80
Safari Nightly	334		43
Opera 9.6	1307		497
IE 6		1948		738
IE 7		1295		830
Chrome		490		30

width/height Tests

We tested both the width, height, innerWidth, innerHeight, outerWidth, and outerHeight methods on our test page.

Frameworks	jQuery 1.3	jQuery 1.3.2
Firefox 3	310		106
Firefox 3.1	281		84
Safari 3.2	146		37
Safari Nightly	166		32
Opera 9.6	345		116
IE 6		313		124
IE 7		283		123
Chrome		113		27