jQuery 1.2.3: AIR, Namespacing, and UI Alpha... :D PDF Print E-mail
Digg!

jQuery team announced availability of jQuery 1.2.3 version.

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:


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.

 



Reddit!Del.icio.us!Facebook!Slashdot!Netscape!Technorati!StumbleUpon!Newsvine!Furl!Yahoo!Ma.gnolia!
 

Jomwitter Twitter Badge

Who's Online

We have 70 guests online

Syndication