Since the last jQuery Summit...
- jQuery 1.5, 1.6, and 1.7
- jQuery UI:
- jQuery Mobile - from alpha to RC!
- Two conferences!
- Breaking News: "jQuery Team" restructured!
Since the last jQuery Summit...
with ( gold < 1 && pager ){}
Wheeeeeeeee!
There are a lot of ways to contribute to jQuery that don't (or do) involve writing JavaScript
jqXHR objectjqXHR has a promise interface (is observable) and is an implementation of...
$.when( somethingHappens() )
.then( doSomethingElse )
.attr() rewrite.attr and .removeAttr for attributes.prop and .removeProp for properties
var select = $("#someSelect");
select.prop( "selectedIndex", 3 );
select[0].selectedIndex = 3;
.css works like .animate
$("#wat").css("width", "+=100px")
$.map()$.map through a plain object to produce an array, instead of having to use $.each
var methodNames = $.map( {
bar: $.noop,
baz: $.noop
}, function(func, name) {
return name;
}); // -> // [ "bar", "baz" ]
// Traditonal callback will fire for each element in the collection
var stuff = $(".stuff").fadeIn( function() { });
// Use the promise interface to wait for all animations to complete and fire a single callback
$.when( stuff ).done(function( elements ) { });
requestAnimationFrame.always: one callback to rule them all!
.pipe: filttering and chaining Deferreds
New.on and .off methods unify
.bind, .delegate, and .live
$("selector").on( events, fn)
// Emulates 1.6 .bind
// Attaches a handler directly to all .foo currently on the page when code is executed
$(".foo").on("click", function(e) {})
$("selector").on( events, selector, fn)
// Emulates 1.6 .delegate
// Attaches a handler to all '.foo' currently on page that will trigger when a '.bar' inside one is clicked
$(".foo").on("click", ".bar", function(e) {})
$(document).on( events, selector, fn)
// Emulates 1.6 live
// Attaches a handler to the document that will trigger when a '.bar' anywhere in the document is clicked
$(document).on("click", ".bar", function(e) {})
matchesSelectortag#id.class.on and .off
// Tells jQuery to include the 'dataTransfer' property on the event object you receive in handlers,
// but only on 'drop' events
jQuery.event.fixHooks.drop = { props: [ "dataTransfer" ] };
$(document).bind("drop", function(e) {
console.log(e.dataTransfer);
// Get the actual native event
console.log( e.originalEvent )
})
$("#foo").append("<aside>Hello There!</aside>");
$("<footer>").appendTo( document.body );
documentFragment when creating new elements
jQuery.Callbacks!"
-Julian Aubourg
$.Deferred
// Using RequireJS
require( ["jquery"], function($) {
$("#foo").addClass("bar");
})
How can we get involved with the jQuery project?
That's OK - There's still a lot you can do if you want to help - and you might just learn a bit in the process.
Any questions?