jQuery Pumpkin

Posted on by

jQuery Halloween Pumpkin

Created by jQuery user Christopher Pickert (of BigFishGames.com), he writes:

"Since Halloween is the perfect time to celebrate the black arts of web development, I carved a special jQuery pumpkin last night. I hope you enjoy it.

Our QA person said that he found a bug in the code, but I explained that it was because of the candle."

He continues:

I did carve that – it’s not photoshop. On an impulse I bought a little $7 battery-operated pumpkin saw at the grocery store, and it’s great because you can do small details more easily. So actually the hard part was drawing the characters first and getting them the right size.

Great work Christopher!

jQuery, Microsoft, and Nokia

Posted on by

We have two pieces of fantastic, albeit serendipitous, news today: Both Microsoft and Nokia are taking the major step of adopting jQuery as part of their official application development platform. Not only will they be using it for their corporate development but they will be providing it as a core piece of their platform for developers to build with.

Microsoft is looking to make jQuery part of their official development platform. Their JavaScript offering today includes the ASP.NET Ajax Framework and they’re looking to expand it with the use of jQuery. This means that jQuery will be distributed with Visual Studio (which will include jQuery intellisense, snippets, examples, and documentation).

Additionally Microsoft will be developing additional controls, or widgets, to run on top of jQuery that will be easily deployable within your .NET applications. jQuery helpers will also be included in the server-side portion of .NET development (in addition to the existing helpers) providing complementary functions to existing ASP.NET AJAX capabilities.

Nokia is looking to use jQuery to develop applications for their WebKit-based Web Run-Time. The run-time is a stripped-down browser rendering engine that allows for easy, but powerful, application development. This means that jQuery will be distributed on all Nokia phones that include the web run-time.

To start Nokia will be moving a number of their applications to work on the run-time (such as Maps) and building them using jQuery. jQuery will become part of their widget development platform, meaning that any developer will be able to use jQuery in the construction of widgets for Nokia phones.

Microsoft and Nokia aren’t looking to make any modifications to jQuery (both in the form of code or licensing) – they simply wish to promote its use as-is. They’ve recognized its position as the most popular JavaScript library and wish to see its growth and popularity continue to flourish.

In fact their developers will begin to help contribute back to the jQuery project by proposing patches, submitting test cases, and providing comprehensive testing against their runtimes. As with any contribution that comes in to the jQuery project it’ll be closely analyzed, reviewed, and accepted or rejected, based upon its merits, by the jQuery development team – no free ride will be given.

A significant level of testing will be added to the project in this respect. The jQuery test suite is already integrated into the test suites of Mozilla and Opera and this move will see a significant level of extra testing being done on Internet Explorer and WebKit – above-and-beyond what is already done by the jQuery team.

The whole jQuery team is quite excited by these prospects and wishes to take this opportunity to welcome both companies to the jQuery community. It’s phenomenal to see these two, major, corporations take the large step of using jQuery as a base for their, and their developers, future development. They will join a long list of happy jQuery users, including Google, Intel, IBM, Intuit, Reuters, and many others.

Update: Blogs posts by Scott Guthrie and Scott Hanselman, both at Microsoft, have posts on the subject matter from their perspective.

Death to JavaScript Rock Stars!

Posted on by

We’ve been listening to your feedback today, about the new jQuery site redesign and one thing has become clear:

Death to JavaScript Rock Stars!

Poor dude didn’t even last 24 hours. We wanted to have some fun with the home page, but this bordered on a little too “extreme” for most tastes.

We plan on bringing some further revisions to the homepage in the future, but in the meantime here’s a quick overhaul, put together by the always-excellent Scott Jehl, that’ll help tide everyone over:

jQuery Homepage

As a token of our appreciation for sticking with the “JavaScript Rock Star” for a day we’ve included a little Easter Egg in the new site. It would be useful if you knew the Konami Code.

Naturally, the whole redesign still has many tweaks that’ll be made over the next couple weeks, especially to individual page fonts, font sizes, and colors.

I want to, once again, thank Scott Jehl for all the hard work that he’s been putting in to the site design – and the excellent Varick Rosete (of nGenWorks and Happy Webbies) for the great illustration that he drew for us.

Here’s to many happy days of rockin’ out with jQuery!

jQuery.com Site Redesign

Posted on by

We’ve just pushed out a brand new site redesign (for jQuery.com and all its sub-sites). This has been a long time coming and it feels great to get it out the door.

New Homepage

jQuery.com

Easily the most contentious part of the redesign – but absolutely the most eye-catching.

jQuery has long been driven by rock, even looking back to its original release which was heavily inspired by the always-excellent Devo. We shot for a catchy design that helped to bring JavaScript out of the cold doldrums that it frequently inhabits – giving it a serious jolt of fun.

New Site Layout

jQuery Docs

The entirety of the site has a new layout. With drastically improved multi-layer navigation and a standardized sidebar it should become much easier to navigate the individual portions of the site.

You should probably wear a hard hat while exploring the interior pages – font sizes, spacing, and colors are all in need of tweaking, which will be handled over the upcoming week (it’s fun working against Trac, WordPress, Drupal, and Mediawiki simultaneously).

New Logo

jQuery Logo

The original jQuery logo was a variation of the Devo hat – we’ve taken that concept, turned it on its ear, and made it something that we can call our own – while still being inspired by the original contours of the Devo Energy Dome.

Thanks

Site and Logo Design: Scott Jehl – he put a fantastic amount of work into this redesign, bringing it all the way from conception to final implementation.

Rockin’ Illustration: Varick Rosete from nGenWorks also of Happy Webbies fame.

Initial Logo Prototyping: Bradley Sepos.

Also want to thank Media Temple for our hosting. They’ve been helping us a lot this past week migrating our sites to some new servers – expect some speed improvements for the sub-domains very soon.

jQuery 1.2.6: Events 100% faster

Posted on by

jQuery 1.2.6 is primarily a bug fix release for jQuery 1.2. You can view the full list of what was fixed on the bug tracker.

This is the next release immediately following jQuery 1.2.3. Releases 1.2.4 and 1.2.5 were skipped (1.2.4 was built incorrectly, rendering it effectively identical to 1.2.3, and 1.2.5 was missing a patch).

The entire jQuery team did a fantastic job in pulling this release together – I want to take this opportunity to thank them all for their continued hard work.

I’d also like to take this opportunity to welcome Ariel Flesler to the core jQuery development team. He provided valuable help in pulling this release together – contributing bug fixes, performance improvements, features, and test cases. You can see the result of his hard work all throughout this release. Welcome Ariel and thank him for all his contributions!

Downloading

jQuery 1.2.6:

If you wish to checkout the full release from the Subversion repository, you can do so by following the instructions and checking out the source from the following location:

svn co http://jqueryjs.googlecode.com/svn/tags/1.2.6

Performance Improvements

Once again the jQuery team has worked hard to bring huge performance improvements in this release. As with previous releases we’ve expanded to look at many areas of the jQuery framework, looking for common pain points, and providing relief.

All data and test cases for the below performance improvements can be found in the the following jQuery 1.2.3 v. 1.2.6 Google Spreadsheet (results for Internet Explorer 6 were excluded in favor of Internet Explorer 7 due to their virtually-identical results).

Event Handling is 103% Faster

In analyzing intense application code (specifically operations such as drag-and-drop) we looked for ways in which universal changes could be made that would affect all users. A frequently-called piece of code was that of the jQuery event handler, any optimizations to it would dramatically improve the performance of all resulting frequently-called events. By focusing improvements here all frequently-called events that you have should see immediate benefits.

CSS Selectors are 13% faster

A number of optimizations have been made to internal jQuery methods, dramatically improving their performance, while providing measurable benefit to some of the most commonly used code in jQuery (such as the CSS Selector code).

For example the jQuery.map() method is now 866% faster and jQuery.extend() is 19% faster. These two changes have allowed for dramatic improvements in performance all throughout the library.

.offset() is 21% faster

Together with the improvements to jQuery’s event handling code optimizations of .offset() have allowed intense mouse-based operations to become much faster. For example jQuery UI’s drag-and-drop code is now over 300% faster because of these change (allowing you to achieve faster, smoother, drag-and-drop operations).

.css() is 25% faster

A method that’s frequently called (both internally and externally). The optimizations to this method are easily felt in others (like .offset(), for example).

New Features and Major Changes

Dimensions Plugin is Now Part of Core

The remaining methods of the Dimensions plugin, by Brandon Aaron, have been introduced into jQuery core, along with additional bug fixes and performance improvements. This plugin has seen considerable use amongst developers and plugin authors and has become a solid part of the jQuery ecosystem. We’ve been, slowly, introducing the most-used methods from the Dimensions plugin over the past couple releases – but with the release of 1.2.6 all remaining methods are now part of core.

If you’re upgrading your copy of jQuery to version 1.2.6 you can now opt to exclude the Dimensions plugin from your code.

The full documentation for Dimensions can be found on the jQuery documentation site (and is in the process of becoming integrated with the core jQuery documentation).

.attr() overhaul

The .attr() method has been completely overhauled (resolving about 15 outstanding bugs). Additionally, the method has been significantly simplified and optimized.

.toggle() can now accept more functions

Historically jQuery’s .toggle() function has accepted two functions (to be toggled in an even/odd manner). However that has been changed so that any number of functions can be provided and toggled by a mouse click.

$("div").toggle(function(){
  $(this).removeClass("three").addClass("one");
}, function(){
  $(this).removeClass("one").addClass("two");
}, function(){
  $(this).removeClass("two").addClass("three");
});

You can now unbind bound .toggle() and .one() functions

function test(){ $(this).addClass("test"); }
$("div").one("click", test);
$("div").unbind("click", test);

$("div").toggle(test, test);
$("div").unbind("click", test);

.index() supports jQuery collections

jQuery’s .index() function has allowed you to find the location of a DOM element in the jQuery collection – now you can also specify a jQuery collection (the first element of which will be extracted and located in the original set).

var test = $("div.test");
$("div").index( test ) == 3

jQuery.makeArray can convert ANYTHING to an array.

jQuery’s internal .makeArray() method now converts any array-like object into a new array. Additionally it wraps all other objects as an array and returns the resulting set.

jQuery.makeArray( document.getElementsByTagName("div") )
// => [ div, div, div ]

jQuery.makeArray( true )
// => [ true ]

jQuery.makeArray()
// => []

beforeSend can cancel Ajax calls

The beforeSend Ajax callback has allowed developers to execute a piece of code prior to a request occurring – now that code can also verify the integrity of some parameters and cancel the resulting Ajax request (useful for tasks like form validation).

$.ajax({
  beforeSend: function(){
    return $("#input").val() == "";
  },
  url: "test.php"
});

Exposed Speeds

jQuery has a number of named animation speeds (such as ‘slow’, ‘fast’, and ‘default’) you can now provide your own names for animation speeds, or modify the existing ones, by manipulating the jQuery.fx.speeds object.

jQuery.fx.speeds.slow = 1000;
$("#test").slideDown("slow");

jQuery 1.2.3: AIR, Namespacing, and UI Alpha

Posted on by

We’re happy to announce a brand new release of jQuery. This is primarily a bug fix release for jQuery 1.2. You can view the full list of what was fixed on the bug tracker.

Downloading

jQuery 1.2.3:

If you wish to checkout the full release from the Subversion repository, you can do so by following the instructions and checking out the source from the following location:

svn co http://jqueryjs.googlecode.com/svn/tags/1.2.3

Important Changes

The primary purpose of this release was to fix a couple outstanding bugs from the jQuery 1.2.2 release. Specifically, this release is now compatible with Adobe AIR, will be included in Drupal 6, and will be the base for jQuery UI 1.5. Additionally, a couple minor features, for plugin developers, were included in this release.

.data() and .removeData()

These methods complement the, already included, jQuery.data and jQuery.removeData methods introduced in jQuery 1.2. The important change, however, is that they’ve been tailored for plugin developers. You can now namespace data additions – like you can with event binding/unbinding. For example:

  $("div").data("test", "original");
  $("div").data("test.plugin", "new data");
  alert( $("div").data("test") == "original" ); // true
  alert( $("div").data("test.plugin") == "new data" ); // true

Additionally, getting or setting data values can be overridden by a plugin. For example, the following code is from the, recently updated, draggables in jQuery UI:

  $(element).bind("setData.draggable", function(event, key, value){
     self.options[key] = value;
  }).bind("getData.draggable", function(event, key){
     return self.options[key];
  });

The above makes it such that all attempts to get and set draggable-namespaced data will be intercepted and handled by the plugin directly (rather than being bound directly to the element). The result is a powerful new interface for dealing with internalized data within a plugin.

.unbind(“.namespace”)

In jQuery 1.2 you could add and remove namespaced events, however you always had to include a name for the type of event being used. With this addition you can now remove all bound events that match a particular namespace, for example:

  $("div").bind("click.plugin", function(){});
  $("div").bind("mouseover.plugin", function(){});
  $("div").unbind(".plugin"); // All handlers removed

The above removes all bound event handlers that are within the “plugin” namespace.

.trigger(“click!”)

Finally, a new addition was included to allow exclusion of namespaced events from being triggered. For example:

  $("div").bind("click", function(){ alert("hello"); });
  $("div").bind("click.plugin", function(){ alert("goodbye"); });
  $("div").trigger("click!"); // alert("hello") only

The above only triggers the non-namespaced event handlers.

Alpha Release: jQuery UI 1.5 and jQuery Enchant 1.0

Last, but not least, we’re pleased to announce a new alpha release of jQuery UI. This is an overhaul of the existing code base with tons of a bug fixes and API tweaks. We need a ton of help testing this alpha, making sure that it’ll be rock-solid for the upcoming release candidate. Please participate in the discussion, helping us to get ready.

Additionally, we’re working on a new plugin called jQuery Enchant which will bring a ton of advanced effects to the library (like clip, shake, and explode – to name a few). This is an alpha release of this plugin, as well – so please help us test it and make sure that it’s completely up to the jQuery level of quality.

Download

Demos

Enjoy!

Workin’ Hard

Posted on by


Paul Bakaus (jQuery UI Lead) and John Resig (jQuery Lead) working on
the next release of jQuery UI (1.5) and jQuery Core (1.2.3).

It’s a rare treat, in distributed Open Source development, to be able to work face-to-face with a fellow developer. Paul is located in Germany, I in Boston – and much of the jQuery team is scattered around the globe. He stopped into town for the weekend so that we could make sure that all the necessary code was in jQuery core for the upcoming jQuery UI 1.5 release candidate. We also had a chance to discuss the future of jQuery UI and plan out some of the best resource allocations for the upcoming months.

All that being said, this next release is going to be fantastic. It’s what jQuery UI 1.0 should have been. It’s been rough because of all the constraints on developer time that were in place when we first set out with this project, but it’s been getting better. Paul now works on jQuery UI full-time – and Liferay is putting a ton of resources towards making sure that the future of the library will be successful. It’s really exciting to see this project grow up and start to see some light.

jQuery 1.2.3 should be released within the next couple days (after some more testing) and jQuery UI 1.5rc1 will be announced on the jQuery UI mailing list at about that time.

Reposted from my blog.

jQuery 1.2.2: 2nd Birthday Present

Posted on by

On the 2nd anniversary of jQuery’s release we’re proud to bring you a brand new release of jQuery. This is primarily a bug fix release for jQuery 1.2. You can view the full list of what was fixed on the bug tracker.

Downloading

jQuery 1.2.2:

If you wish to checkout the full release from the Subversion repository, you can do so by following the following instructions and checking out the source from the following location:

svn co http://jqueryjs.googlecode.com/svn/tags/1.2.2

Important Changes

A lot of hard work was put into this release by Brandon Aaron and David Serduke. David is a new addition to the jQuery core development team and has been making significant contributions – please help us in welcoming him!

Primarily, this has been a bug fix and optimization release. We landed over 120 bug fixes and our test suite now has over 1157 tests in it – which we are quire proud of.

300% Speed Improvements to $(DOMElement)

Once again, we’ve taken a step at micro-improving the most-used features in jQuery. Specifically, the use of passing a DOM element into the jQuery function. (Most frequently used when you see stuff like $(this) in your code.)

Here’s a quick peak at some of the speed jumps that you can expect in all the major browsers:

Browser 1.2.1 (ms) 1.2.2 (ms)
Firefox 2 0.041 0.015
Firefox 3 0.033 0.01
Safari 3 0.017 0.005
Opera 9 0.023 0.004
Internet Explorer 6 0.04 0.03

.ready() Overhaul

The document ready function has been long due for some extra love. We’ve made a number of specific changes.

* Internet Explorer document ready drastically improved. We use a new technique inspired by Diego Perini. It allows us to not have to do a document.write() anymore, which is really fantastic.
* All browsers now wait for CSS to be ready, in addition to just the DOM. In reality, it’s not just a vanilla document ready anymore – but we found that users, overwhelmingly, needed to wait for document styling to be active (such as knowing if an element is visible, or what its height is). Specifically we’ve added improvements to Safari and Opera to make this possible.
* $(document).bind("ready", fn); – You can now watch for the document ready event via the traditional .bind() function. Of course, .ready() still works as you would expect it to.

.bind(“mouseenter”) / .bind(“mouseleave”)

The functionality that was the core of the .hover() function has been split out into two new cross-browser events: mouseenter and mouseleave. These are different from mouseover and mouseout as those events will fire as you move in and out of child elements (which is generally not desired). For example, the following are both valid and work perfectly in jQuery 1.2.2:

$("li").hover(function(){
  $(this).addClass("hover");
}, function(){
  $(this).removeClass("hover");
});
$("li").bind("mouseenter", function(){
  $(this).addClass("hover");
}).bind("mouseleave", function(){
  $(this).removeClass("hover");
});

.bind(“mousewheel”)

We have a new plugin, written by Brandon Aaron, based on the new Event API which adds mousewheel event support to jQuery core. This will allow you to write things like:

$("div").bind("mousewheel", function(event, delta){
  if ( delta < 0 )
    $(this).append("up");
  else
    $(this).append("down");
});

Complex :not()

Even though it's not part of the CSS 3 specification it's been a common feature request - so you can now do complex expressions in your :not() selectors. For example, the following now work:

$(".hover:not(li.active)")
$("li:not(.active,.hover,:contains(test))")

Accept Headers

For normal jQuery Ajax operations we now send an extra Accept header to let the server know what kind of content we're looking for. If you specify a dataType argument then we'll take care of all the header setting for you. We currently send the following headers for each dataType.

  • xml "application/xml, text/xml"
  • html "text/html"
  • script "text/javascript, application/javascript"
  • json "application/json, text/javascript"
  • text "text/plain"
  • Everything else: "*/*"

Bug Fixes

Here's a sampling of some of the functionality that's seen some important overhauling.

* .clone() overhaul
* Script evaluation overhaul
* height() / width() overhaul
* Cross-frame DOM manipulation
* A few memory leaks have been resolved

Event API

There's a new API for dealing with events. You can now create your own custom event types (with custom ways of being set up and torn down). Effectively, it allows you to go beyond simple event triggering and create a full scheme for attaching, handling, and tearing down events on an element. A demonstration plugin was created by Brandon Aaron that you can use to learn the powerful new API.

jQuery UI: Interactions and Widgets

Posted on by
Meet the jQuery UI team at jQueryCamp Boston!
We’re having a free one day conference this October and most of the jQuery, and jQuery UI, teams will be there. Come along, ask questions, and meet the people who build the library that you love!

User Interface - Green

Today we’re very pleased to announce a brand new library: jQuery UI. jQuery UI is a fully themed interaction and widget library built on top of jQuery.

You’ll be able to find everything that you need to know about jQuery UI on it’s site:
http://ui.jquery.com/

jQuery UI signals the start of a whole new branch of the jQuery project which will focus on developing high-quality, reusable, components that you’ll be able to drop in your applications. Frequently, these components are coming directly to you from traditional jQuery plugins, but with strict coding, documentation, themeing, and demo standards. We hope you’ll enjoy this new level of quality as much as we do.

We’re launching with one complete theme: Flora (designed by Tom) and two partially-complete themes: Light and Dark (by Sean). Within the next week we’re going to be announcing the details of a new theming competition, along with everything that you need to completely build your own jQuery UI theme.

Note: jQuery UI requires that you use, at least, jQuery 1.2.1 or newer.

Please be kind, there’s still going to be a mess of rough edges, as is to be expected with a brand new project. Please submit bugs to the bug tracker under the “UI” component and bring them up for discussion on the jQuery UI Mailing List. We appreciate your help.

Without further ado, here’s jQuery UI!

Demo App: Advanced Image Gallery

(Currently has issues in IE and Safari – we’re working on some fixes which should be up later today.)

Demo App: Bar Chart Navigation

(Currently only works in browsers that have Canvas support: Firefox, Safari, and Opera.)

Features: Mouse Interaction

Draggables (Docs)

Droppables (Docs)

Sortables (Docs)

Selectables (Docs)

Resizables (Docs)

Features: Widgets

Accordion (Docs)

Calendar (Docs)

Dialog (Docs)

Slider (Docs)

Tablesorter (Docs)

Tabs (Docs)

Features: Effects

Magnifier (Docs)

Shadow (Docs)

Contributors

This is the result of many months of work by over a dozen people – many of whom were first time contributors to jQuery.

For now, here’s a rough list of everyone who helped, and what they helped with. (Please let me know if I forgot anyone!)

  • Paul B (Draggables, Droppables, Sortables, Resizables, Slider, Shadow, Magnifier, Gallery App)
  • John (Documentation, Theming, Demos, UI Site, Cat Herding)
  • Richard (Tree, Selectables, Sortables, Dialog, many bug fixes)
  • Tom (Flora theme, UI Site, and UI logo)
  • Sean (Theming, Dark and Light themes, Shadow, Forms)
  • Klaus (Tabs)
  • Joern (Accordion)
  • Christian (Tablesorter)
  • Adel (Downloader, Client-Side)
  • Paul H (Downloader, Server-Side)
  • Marc (Calendar)

With additional help from: Tane, Micheil, Gilles, Dmitri, and Yehuda. Much of their work will be seen in the next release of jQuery UI (including menus, toolbars, uploaders, splitters, and rich text editors).

I’d like to do a more-detailed write up of what everyone put into this project to thank everyone individually, as everyone did a really fantastic job of pulling together and making this happen. Paul, Tom, Richard, and Sean, especially – you guys did a superb job!

Once again, I hope everyone enjoys this new work – please be kind, it’s still got some very rough edges, so to speak. If you spot any bugs, please post them to the bug tracker under the “UI” component.

As always, feedback is appreciated! If you’d like to let us know what you think, please post to the jQuery UI Mailing List, or hop on irc.freenode.net #jquery-ui, as those are the best place to be able to find us.

Enjoy!

If you like what you see, feel free to give it a digg.

jQuery 1.2.1: Quick Fixes for 1.2

Posted on by

jQuery 1.2.1 is a bug fix release for jQuery 1.2. You can view the full list of what was fixed on the bug tracker.

Downloading

jQuery 1.2.1:

If you wish to checkout the full release from the Subversion repository, you can do so by following the following instructions and checking out the source from the following location:

 svn co http://jqueryjs.googlecode.com/svn/tags/1.2.1

Important Changes

Relative Animations

There was a serious error in the API for the new relative animations that caused a conflict with existing animation styles. To resolve this, in order to do a relative animation, you must now use the following syntax:

 $(...).animate({ height: "+=50px", width: "-=20%", fontSize: "+=2em" });

With += meaning “Add to the current position” and -= meaning “Take away from the current position”.

.eq()

Due to some very-persuasive arguments, and a great deal of reconsideration, .eq() has been brought back. A great number of plugins rely on this single method – and the alternative provided by .slice() simply wasn’t as elegant a solution as what was originally provided.