jQuery 1.7 Released

Posted on by

jQuery 1.7 is ready for download! You can get the code from the jQuery CDN:

This new release should also be available on the Google and Microsoft CDNs within a day or two.

Thanks to your help in testing and reporting bugs during the beta period, we believe we have a solid, stable release. If you do find problems, file a bug and be sure to choose jQuery 1.7 in the version selection. Also be sure to provide a jsFiddle test case so we can quickly analyze the problem.

What’s New in jQuery 1.7

The Version 1.7 tag at the API site is a great way to get up to speed with the new things in this release. Here’s a rundown of the big items in 1.7 and some things not yet mentioned in the API docs.

New Event APIs: .on() and .off()

The new .on() and .off() APIs unify all the ways of attaching events to a document in jQuery — and they’re shorter to type!

$(elements).on( events [, selector] [, data] , handler );
$(elements).off( [ events ] [, selector] [, handler] );

When a selector is provided, .on() is similar to .delegate() in that it attaches a delegated event handler, filtered by the selector. When the selector is omitted or null the call is like .bind(). There is one ambiguous case: If the data argument is a string, you must provide either a selector string or null so that the data isn’t mistaken as a selector. Pass an object for data and you’ll never have to worry about special cases.

All the existing event binding methods (and their corresponding unbinding methods) are still there in 1.7, but we recommend that you use .on() for any new jQuery project where you know version 1.7 or higher is in use. Here are some examples of mapping between the old and new API calls:

$('a').bind('click', myHandler);
$('a').on('click', myHandler);

$('form').bind('submit', { val: 42 }, fn);
$('form').on('submit', { val: 42 }, fn);

$(window).unbind('scroll.myPlugin');
$(window).off('scroll.myPlugin');

$('.comment').delegate('a.add', 'click', addNew);
$('.comment').on('click', 'a.add', addNew);

$('.dialog').undelegate('a', 'click.myDlg');
$('.dialog').off('click.myDlg', 'a');

$('a').live('click', fn);
$(document).on('click', 'a', fn);

$('a').die('click');
$(document).off('click', 'a');

Improved Performance on Delegated Events

Event delegation has become increasingly important as size and complexity of pages grow. Application frameworks such as Backbone, JavaScriptMVC, and Sproutcore make heavy use of event delegation. With that in mind, jQuery 1.7 event handling was refactored with an eye to making delegated events much faster, especially for the most common cases.

To optimize the code for the most commonly used forms of selectors, we examined a cross-section of code from Google Codesearch. Nearly two-thirds of the selectors used in .live() and .delegate() method calls were in the form tag#id.class where one or more of tag, id, or class were used. By parsing those simple selectors in JavaScript at the time the event was attached, we were able to outperform even the browser’s native-code implementations of matchesSelector during event delivery. For more complex selectors we still use the Sizzle engine, so all existing code should continue to work.

The final result is that delegated events are delivered in about half the time they took in 1.6.4:

Better Support for HTML5 in IE6/7/8

Anyone who has tried to use the new HTML5 tags such as <section> has no doubt run across the problem that IE 6/7/8 not only don’t understand these tags, they actually remove them from the document. With jQuery 1.7 we built in support for using HTML5 tags in older IEs with methods like .html(). This support is on par with what previously required innerShiv. You must still include html5shiv (or Modernizr) in the head of your document in older IEs for HTML5 tag support. For more background, see The Story of the HTML5 Shiv.

Toggling Animations Work Intuitively

In previous versions of jQuery, toggling animations such as .slideToggle() or .fadeToggle() would not work properly when animations were stacked on each other and a previous animation was terminated with .stop(). This has been fixed in 1.7 so that the animation system remembers the elements’ initial values and resets them in the case where a toggled animation is terminated prematurely.

Asynchronous Module Definition (AMD)

jQuery now supports the AMD API. Note that jQuery 1.7 is not a script loader itself; it cooperates with AMD-compliant loaders such as RequireJS or curl.js so it can be loaded dynamically and the ready event can be controlled by the loader. Now an AMD-compliant loader can load an unmodified version of jQuery 1.7 from a CDN such as Google’s or Microsoft’s. Many thanks to James Burke (@jrburke) for submitting the patch and unit tests, then waiting patiently for us to incorporate it.

jQuery.Deferred

The jQuery.Deferred object has been extended with new progress handlers and notification methods that call those handlers. This allows you to asynchronously notify listeners of progress in a request without resolving or rejecting the request. In addition, there is a new state() method that returns the current state of the Deferred; it’s primarily useful for debugging.

Deferreds are now implemented using a new jQuery.Callbacks feature, a generalized way of queueing and triggering a series of handlers. This feature may be of interest to plugin writers, although Deferreds and the event subsystem provide a higher-level interface for this type of functionality.

jQuery.isNumeric()

Inside jQuery we’ve found several situations where we need to know if an argument is numeric, or would be successfully converted to a number if it is some other type. We decided to write and document jQuery.isNumeric() since it’s a useful utility. Pass it an argument of any type and it returns true or false as appropriate.

Removed Features

event.layerX and event.layerY: We have removed these non-standard properties in version 1.7. Although we normally would have gone through a deprecation notice period for these, Chrome version 16 generates a flood of console warning messages on the page. Because of this, we decided to remove them immediately. On platforms that still support these properties, they are available through event.originalEvent.layerX and event.originalEvent.layerY.

jQuery.isNaN(): This undocumented utility function has been removed. It was confusing because it appropriated the name of a built-in JavaScript function but did not have the same semantics. The new jQuery.isNumeric() serves a similar purpose, but has the benefit of being documented and supported. Despite jQuery.isNaN() being undocumented, several projects on Github were using it. We have contacted them and asked that they use jQuery.isNumeric() or some other solution.

jQuery.event.proxy(): This undocumented and deprecated method has been removed. Users should be calling the documented jQuery.proxy method instead.

The jQuery Team, and Your Part

I want to recognize the incredible work of our regular team contributors in getting this release out the door, especially Timmy Willison (timmywil on Github), Corey Frang (gnarf), Rick Waldron (rwldrn), and Julian Aubourg (jaubourg). Karl Swedberg (kswedberg) and Addy Osmani (addyosmani) worked hard on getting the new documentation into shape on the API site. Also, thanks to Mike Sherov (mikesherov), a greenhorn contributor who has already created patches for several tricky bugs. Many thanks to all the others who reported bugs, submitted pull requests, reviewed commits, and in other ways made sure we did the best job we possibly could.

Still, we can always use more help, and that is where you can contribute. The simplest and most important thing you can do is occasionally test our work-in-progress against your code and your expectations. It’s always located at http://code.jquery.com/jquery-git.js and a fresh copy is built each time a new commit is made to our master branch at github.com. If you find a bug in a final release, test against jquery-git.js to see if it’s already been fixed. It’s easy as pie since jsFiddle.net offers an option to test your code with the jquery-git.js file as “jQuery (edge)”.

If you’d like to do more, we’d be glad to have you pitch in! We’ve written a document that can get you started with the process, and one or more of us are generally available in the #jquery-dev channel on IRC if you need more help or information.

jQuery 1.7 Change Log

The current change log of the 1.7 release.

Ajax

  • #9399: Deprecate jqXHR.success and jqXHR.error

Attributes

  • #5479: removeAttr: remove multiple attributes
  • #6743: map enctype to encoding, depending on browser
  • #10176: Injected script tag is evaluated twice
  • #10278: checkboxEl.attr(‘checked’) returns stale value after checkboxEl.click()
  • #10429: IE7 – invalid procedure call or argument when calling removeAttr(‘contenteditable’);
  • #10514: removeAttr does not remove the class attribute in IE6/7

Core

  • #6485: Solution for HTML5 in IE
  • #7102: Register jQuery as a CommonjS async module
  • #9453: $.inArray does not support fromIndex
  • #10478: Switch jQuery.isNaN to jQuery.isNumeric

Css

  • #10267: IE8 and window is(‘:visible’) crashes

Data

  • #7323: Allow removing multiple data keys at once with $.fn.removeData
  • #8909: $(element).data() will scan all attributes more than needed.
  • #8921: jQuery private data should stay private

Deferred

  • #8856: Request: deferred.isUnresolved()
  • #9033: try{ } finally{ } error in IE8
  • #9398: Proposal for Improved Deferreds

Dimensions

  • #9434: .outerWidth()/.outerHeight()/.innerWidth()/.innerHeight() should work on window and document

Effects

  • #5684: Effects: exception in animation callback causes endless loop
  • #6150: .stop sometimes doesn’t clear .delay
  • #6641: Calling stop() within animation finished callback causes other animations to freeze
  • #8685: Animations should keep track of animation state in order to properly address stacked animations
  • #9280: Allow multiple effect queues for animate()
  • #9548: animate does not work with fill-opacity css property for svg elements
  • #10445: Setting queue to true causes an error
  • #10497: .stop should allow choosing which queue to stop
  • #10622: .show() does not properly restore CSS-set “display” value

Event

  • #3368: event.metaKey should be assigned to event.ctrlKey on Non-Mac only
  • #6170: jQuery(window).scroll(); causes IE* to scroll to 0,0
  • #6319: Regression: stopPropagation inside change handlers in IE is incorrectly applied to keydown event
  • #6386: support data argument for live events via “event.special.live.add”
  • #6593: IE8: DOM 0 event handler called twice when a separate handler is attached via jQuery
  • #6667: submit event doesn’t delegate in IE* under certain conditions
  • #6903: special events need a way to determine whether they are being bound with .bind vs .live/.delegate
  • #6942: JQuery.event.fix causes unnecessary reflows in IE when handling key events
  • #7139: “hover” event alias should work for .bind as well as .live
  • #7161: Submit event on a form element not unbound properly in IE
  • #7444: Submitting form with “Enter” instead of button click on ie8 or ie7 triggers live submit event twice.
  • #8157: Focusing an already focused text field will prevent the change event from firing in IE
  • #8728: Event ‘mouseenter’ not firing when the element being left is removed on leaving
  • #8789: Meta: Event Property Hooks
  • #8858: Special events – _default method doesn’t have access to the `data` argument of the trigger method
  • #8866: IE8 input[type=file] delegated change event files only on blur
  • #8982: bind(“unload someOther”) => on unload, handler is not executed only once.
  • #9069: when hover over a child of an element, mouseleave fires when using live or delegate
  • #9279: delegate() bind does not handle mouseover/mouseout and mouseenter/mouseout correctly for selected elements
  • #9393: Unify and DRY out event system
  • #9593: Delegated submit event is not instanceof jQuery.Event in IE
  • #9724: Infinite loop in trigger function when window.parentNode is a DOM element
  • #9901: event.handleObj.namespace incorrect when using .delegate
  • #9933: jQuery.fn.toggle() should store state in private data object
  • #9951: Wrong order in .trigger() when DOM is modified in a handler
  • #10375: Do not include `type` in jQuery.event.props
  • #10438: Rename jQuery.event.propHooks => .fixHooks
  • #10468: Remove deprecated jQuery.event.guid and jQuery.event.proxy
  • #10489: Disconnected elements bubble to window on .trigger()
  • #10531: Consider removing layerX and layerY from $.event.props
  • #10563: jQuery.Event no longer contains the element that matched the selector in event delegation.
  • #10567: Delegated events incorrectly match class names
  • #10575: Breaking changes in live event propagation between 1.6.4 and 1.7rc1
  • #10576: jQuery1.7rc1 and jQueryMobile1.0rc2 – IE gets error in jqm triggerCustomEvent method

Manipulation

  • #6782: carefully allow more strings to use innerHTML
  • #7037: Duplicate mouseover and mouseout events added to cloned element.
  • #10501: HTML5 element “innerShiv” inconsistent across html()/append()

Misc

  • #10420: MouseWheel
  • #10553: Further reduction of minimal license header

Selector

  • #3144: Inconsistent cross-browser results from .text() method
  • #5637: Boolean (and Empty) Attribute Selectors Fail
  • #6863: faster getText
  • #7128: attribute selector is inconsistent between qSA and Sizzle due to use of DOM properties
  • #8539: Sizzle cache collision in browsers without querySelectorAll
  • #9261: Has Attribute not working in filter/children/siblings
  • #9570: Selector $(‘form[name=".."]‘) returns zero elements in IE8 under some conditions
  • #10178: $(window).is(“a”) >> Uncaught TypeError: Cannot call method ‘toLowerCase’ of undefined
  • #10315: Sizzle ignores seed argument when using positional selectors
  • #10562: siblings method returns unexpected elements when using Sizzle-invoking pseudo-selectors

Support

  • #5145: jQuery.support.opacity = false in the Chrome browser
  • #6809:

jQuery Conference 2012: United Kingdom Announced

Posted on by

jQuery Conference 2012: UK

We are very happy to announce jQuery Conference 2012: UK, the first jQuery conference in the UK, on 10th February 2012. The conference will be held at the Saïd Business School in Oxford with a line-up including six jQuery team members and four industry experts:

jQuery Conference 2012: UK Speakers

Tickets

You can read more about the line-up, talks and location on the event site and tickets are on sale now at EventBrite.

Organizers

The event is being organized by Oxford based digital agency White October with the permission of the jQuery project and with the help and support from jQuery team members. Last year, the jQuery events team tried to put together an event outside the USA and we found how very hard it was to secure a venue from so far away. The jQuery Team is very happy to be working with White October in putting the conference together, and we hope to have you join as we make our European debut!

Sponsorship

If your company is interested in sponsoring the event please take a look at the sponsor pack, please feel free to email or phone (+44(0)207 976 4894) John at White October to discuss the different options.

jQuery 1.7 RC2 Released

Posted on by

Today, after a very scary Halloween, the jQuery team is releasing jQuery 1.7 RC2 from our Github crypt, er, repo. Barring a report of really terrifying problems or a mob of townspeople at our door with torches, this code will be exactly the same code that becomes the version 1.7 final. If anyone knows of any reason why this code should not become a final release, we need to hear you scream!

HERE LIE THE
BITS FOR RC2;
PLEASE TELL US
IF IT WORKS
FOR YOU

In RC2, we fixed a tricky problem that sometimes caused Internet Explorer 8 to go full-zombie when jQuery was loaded. Appropriately enough, the crash was related to creating a detached <body> element that we were using to perform feature detection. IE8 seems frightened to a crashy death when it sees a detached body. If you still see any problems with IE8 crashes, please let us know.

Thanks to a bug report from @warrenparsons, we also fixed a frightful regression with the .show() method. We really appreciate the efforts from those of you who are testing these pre-release versions. Sure, it’s a lot easier to think, “I’ll try it when it’s finally released,” but then any problems you do find will be preventing you — and possibly hundreds or thousands of others — from upgrading. Now that is really scary, at least to us.

During the next day or so we’ll be conjuring up documentation for many of the 1.7 additions and improvements on api.jquery.com. Please bear with us for a few days while we clean up the pages and make sure that it is filled in and all linked properly. For a quick overview of what’s changed, see the 1.7 category.

jQuery 1.7 RC 2 Change Log

The current change log of the 1.7 RC2 release.

Ajax

  • #9399: Deprecate jqXHR.success and jqXHR.error

Attributes

  • #5479: removeAttr: remove multiple attributes
  • #6743: map enctype to encoding, depending on browser
  • #10176: Injected script tag is evaluated twice
  • #10278: checkboxEl.attr(‘checked’) returns stale value after checkboxEl.click()
  • #10429: IE7 – invalid procedure call or argument when calling removeAttr(‘contenteditable’);
  • #10514: removeAttr does not remove the class attribute in IE6/7

Core

  • #6485: Solution for HTML5 in IE
  • #7102: Register jQuery as a CommonjS async module
  • #9453: $.inArray does not support fromIndex
  • #10478: Switch jQuery.isNaN to jQuery.isNumeric

Css

  • #10267: IE8 and window is(‘:visible’) crashes

Data

  • #7323: Allow removing multiple data keys at once with $.fn.removeData
  • #8909: $(element).data() will scan all attributes more than needed.
  • #8921: jQuery private data should stay private

Deferred

  • #8856: Request: deferred.isUnresolved()
  • #9033: try{ } finally{ } error in IE8
  • #9398: Proposal for Improved Deferreds

Dimensions

  • #9434: .outerWidth()/.outerHeight()/.innerWidth()/.innerHeight() should work on window and document

Effects

  • #5684: Effects: exception in animation callback causes endless loop
  • #6150: .stop sometimes doesn’t clear .delay
  • #6641: Calling stop() within animation finished callback causes other animations to freeze
  • #8685: Animations should keep track of animation state in order to properly address stacked animations
  • #9280: Allow multiple effect queues for animate()
  • #9548: animate does not work with fill-opacity css property for svg elements
  • #10445: Setting queue to true causes an error
  • #10497: .stop should allow choosing which queue to stop
  • #10622: .show() does not properly restore CSS-set “display” value

Event

  • #3368: event.metaKey should be assigned to event.ctrlKey on Non-Mac only
  • #6170: jQuery(window).scroll(); causes IE* to scroll to 0,0
  • #6319: Regression: stopPropagation inside change handlers in IE is incorrectly applied to keydown event
  • #6386: support data argument for live events via “event.special.live.add”
  • #6593: IE8: DOM 0 event handler called twice when a separate handler is attached via jQuery
  • #6667: submit event doesn’t delegate in IE* under certain conditions
  • #6903: special events need a way to determine whether they are being bound with .bind vs .live/.delegate
  • #6942: JQuery.event.fix causes unnecessary reflows in IE when handling key events
  • #7139: “hover” event alias should work for .bind as well as .live
  • #7161: Submit event on a form element not unbound properly in IE
  • #7444: Submitting form with “Enter” instead of button click on ie8 or ie7 triggers live submit event twice.
  • #8157: Focusing an already focused text field will prevent the change event from firing in IE
  • #8728: Event ‘mouseenter’ not firing when the element being left is removed on leaving
  • #8789: Meta: Event Property Hooks
  • #8858: Special events – _default method doesn’t have access to the `data` argument of the trigger method
  • #8866: IE8 input[type=file] delegated change event files only on blur
  • #8982: bind(“unload someOther”) => on unload, handler is not executed only once.
  • #9069: when hover over a child of an element, mouseleave fires when using live or delegate
  • #9279: delegate() bind does not handle mouseover/mouseout and mouseenter/mouseout correctly for selected elements
  • #9393: Unify and DRY out event system
  • #9593: Delegated submit event is not instanceof jQuery.Event in IE
  • #9724: Infinite loop in trigger function when window.parentNode is a DOM element
  • #9901: event.handleObj.namespace incorrect when using .delegate
  • #9933: jQuery.fn.toggle() should store state in private data object
  • #9951: Wrong order in .trigger() when DOM is modified in a handler
  • #10375: Do not include `type` in jQuery.event.props
  • #10438: Rename jQuery.event.propHooks => .fixHooks
  • #10468: Remove deprecated jQuery.event.guid and jQuery.event.proxy
  • #10489: Disconnected elements bubble to window on .trigger()
  • #10531: Consider removing layerX and layerY from $.event.props
  • #10563: jQuery.Event no longer contains the element that matched the selector in event delegation.
  • #10567: Delegated events incorrectly match class names
  • #10575: Breaking changes in live event propagation between 1.6.4 and 1.7rc1
  • #10576: jQuery1.7rc1 and jQueryMobile1.0rc2 – IE gets error in jqm triggerCustomEvent method

Manipulation

  • #6782: carefully allow more strings to use innerHTML
  • #7037: Duplicate mouseover and mouseout events added to cloned element.
  • #10501: HTML5 element “innerShiv” inconsistent across html()/append()

Misc

  • #10420: MouseWheel
  • #10553: Further reduction of minimal license header

Selector

  • #3144: Inconsistent cross-browser results from .text() method
  • #5637: Boolean (and Empty) Attribute Selectors Fail
  • #6863: faster getText
  • #7128: attribute selector is inconsistent between qSA and Sizzle due to use of DOM properties
  • #8539: Sizzle cache collision in browsers without querySelectorAll
  • #9261: Has Attribute not working in filter/children/siblings
  • #9570: Selector $(‘form[name=".."]‘) returns zero elements in IE8 under some conditions
  • #10178: $(window).is(“a”) >> Uncaught TypeError: Cannot call method ‘toLowerCase’ of undefined
  • #10315: Sizzle ignores seed argument when using positional selectors
  • #10562: siblings method returns unexpected elements when using Sizzle-invoking pseudo-selectors

Support

  • #5145: jQuery.support.opacity = false in the Chrome browser
  • #6809: Add jQuery.support.fixedPosition
  • #10558: Test Support bug
  • #10613: IE8 doesn’t like a detached body in its head

Traversing

  • #10449: Function $(“#id”).closest(“.class”) returns element $(“#id”) itself if it has .class

jQuery 1.7 RC1 Released

Posted on by

The team is getting closer to jQuery 1.7, and today we’re putting out a release candidate. The full list of fixes and features can be found below. We urge everyone to start testing this code in their applications, so we can make sure that there are no major problems before the final release.

Testing couldn’t be simpler, you can get the code from the jQuery CDN:

Please help us by dropping that code into your existing application. If you see something, say something. File a bug and mention that you’re testing against jQuery 1.7 RC1. If there’s a problem we want to fix it.

In the meantime, we’re working on the documentation and release notes to make sure your transition to 1.7 goes smoothly. Stay tuned!

jQuery 1.7 RC 1 Change Log

The current change log of the 1.7 RC 1 release.

Ajax

  • #9399: Deprecate jqXHR.success and jqXHR.error

Attributes

  • #5479: removeAttr: remove multiple attributes
  • #6743: map enctype to encoding, depending on browser
  • #10176: Injected script tag is evaluated twice
  • #10278: checkboxEl.attr(‘checked’) returns stale value after checkboxEl.click()
  • #10429: IE7 – invalid procedure call or argument when calling removeAttr(‘contenteditable’);
  • #10514: removeAttr does not remove the class attribute in IE6/7

Core

  • #6485: Solution for HTML5 in IE
  • #7102: Register jQuery as a CommonjS async module
  • #9453: $.inArray does not support fromIndex
  • #10478: Switch jQuery.isNaN to jQuery.isNumeric

Css

  • #10267: IE8 and window is(‘:visible’) crashes

Data

  • #7323: Allow removing multiple data keys at once with $.fn.removeData
  • #8909: $(element).data() will scan all attributes more than needed.
  • #8921: jQuery private data should stay private

Deferred

  • #8856: Request: deferred.isUnresolved()
  • #9033: try{ } finally{ } error in IE8
  • #9398: Proposal for Improved Deferreds

Dimensions

  • #9434: .outerWidth()/.outerHeight()/.innerWidth()/.innerHeight() should work on window and document

Effects

  • #5684: Effects: exception in animation callback causes endless loop
  • #6150: .stop sometimes doesn’t clear .delay
  • #6641: Calling stop() within animation finished callback causes other animations to freeze
  • #8685: Animations should keep track of animation state in order to properly address stacked animations
  • #9280: Allow multiple effect queues for animate()
  • #9548: animate does not work with fill-opacity css property for svg elements
  • #10416: defaultDisplay returns block instead of table-row for a tr in FF
  • #10445: Setting queue to true causes an error
  • #10497: .stop should allow choosing which queue to stop

Event

  • #3368: event.metaKey should be assigned to event.ctrlKey on Non-Mac only
  • #6170: jQuery(window).scroll(); causes IE* to scroll to 0,0
  • #6319: Regression: stopPropagation inside change handlers in IE is incorrectly applied to keydown event
  • #6386: support data argument for live events via “event.special.live.add”
  • #6593: IE8: DOM 0 event handler called twice when a separate handler is attached via jQuery
  • #6667: submit event doesn’t delegate in IE* under certain conditions
  • #6903: special events need a way to determine whether they are being bound with .bind vs .live/.delegate
  • #6942: JQuery.event.fix causes unnecessary reflows in IE when handling key events
  • #7139: “hover” event alias should work for .bind as well as .live
  • #7161: Submit event on a form element not unbound properly in IE
  • #7444: Submitting form with “Enter” instead of button click on ie8 or ie7 triggers live submit event twice.
  • #8157: Focusing an already focused text field will prevent the change event from firing in IE
  • #8728: Event ‘mouseenter’ not firing when the element being left is removed on leaving
  • #8789: Meta: Event Property Hooks
  • #8858: Special events – _default method doesn’t have access to the `data` argument of the trigger method
  • #8866: IE8 input[type=file] delegated change event files only on blur
  • #8982: bind(“unload someOther”) => on unload, handler is not executed only once.
  • #9069: when hover over a child of an element, mouseleave fires when using live or delegate
  • #9279: delegate() bind does not handle mouseover/mouseout and mouseenter/mouseout correctly for selected elements
  • #9393: Unify and DRY out event system
  • #9593: Delegated submit event is not instanceof jQuery.Event in IE
  • #9724: Infinite loop in trigger function when window.parentNode is a DOM element
  • #9901: event.handleObj.namespace incorrect when using .delegate
  • #9933: jQuery.fn.toggle() should store state in private data object
  • #9951: Wrong order in .trigger() when DOM is modified in a handler
  • #10375: Do not include `type` in jQuery.event.props
  • #10438: Rename jQuery.event.propHooks => .fixHooks
  • #10468: Remove deprecated jQuery.event.guid and jQuery.event.proxy
  • #10489: Disconnected elements bubble to window on .trigger()
  • #10531: Consider removing layerX and layerY from $.event.props
  • #10563: jQuery.Event no longer contains the element that matched the selector in event delegation.

Manipulation

  • #6782: carefully allow more strings to use innerHTML
  • #7037: Duplicate mouseover and mouseout events added to cloned element.
  • #10501: HTML5 element “innerShiv” inconsistent across html()/append()

Misc

  • #10553: Further reduction of minimal license header

Selector

  • #3144: Inconsistent cross-browser results from .text() method
  • #5637: Boolean (and Empty) Attribute Selectors Fail
  • #6863: faster getText
  • #7128: attribute selector is inconsistent between qSA and Sizzle due to use of DOM properties
  • #8539: Sizzle cache collision in browsers without querySelectorAll
  • #9261: Has Attribute not working in filter/children/siblings
  • #9570: Selector $(‘form[name=".."]‘) returns zero elements in IE8 under some conditions
  • #10178: $(window).is(“a”) >> Uncaught TypeError: Cannot call method ‘toLowerCase’ of undefined
  • #10315: Sizzle ignores seed argument when using positional selectors
  • #10562: siblings method returns unexpected elements when using Sizzle-invoking pseudo-selectors

Support

  • #5145: jQuery.support.opacity = false in the Chrome browser
  • #6809: Add jQuery.support.fixedPosition
  • #10558: Test Support bug

Traversing

  • #10449: Function $(“#id”).closest(“.class”) returns element $(“#id”) itself if it has .class

Announcing The jQuery Standards Team

Posted on by

Today we’re happy to announce the creation of a new jQuery sub-team called the jQuery Standards Team to give web developers a voice in the standards process.

Introduction

We all know that web standards are important. They help ensure the code we write works across different technologies, for people of different abilities and most importantly across all browsers.

That said, how often do we all feel our voices, suggestions and ideas are heard by those groups responsible for defining these standards? The reality is that whilst many of us would like to see change, due to time restrictions and lengthy formal processes we’re unable to participate in standards discussions, get involved with writing specifications and contribute to meetings about the future of features. This makes it difficult for web developers to have a voice.



Yehuda Katz is team lead. Paul Irish joins him.

Another problem is that for those that do get involved with the process, it can often feel like participating on a particular thread in standards mailing lists has a limited impact because the web community is so fragmented. Browser vendors are very active on these lists and there’s a tremendous amount of institutional knowledge assumed in almost all threads. Implementors on those lists have their own venues for discussing areas of shared concerns, but web developers wishing to particpate don’t, with the exception of the accidental meetups at conferences.

The jQuery project would like to help change this – we want you to have a voice in how the future of the web is shaped.

The jQuery Standards Team

The jQuery Standards Team has three primary goals:

  • To represent the web developer community, in particular jQuery users, to standards bodies such as the W3C and TC39 with the intention of improving existing standards and standards in progress to better meet the needs of web developers.
  • To represent the web developer community, and especially jQuery users, to browser vendors with the intent of helping them identify standards that they should prioritize for implementing, and proofs of concept that they can build.
  • To help the jQuery project adopt new standards and browser features as appropriate.

This marks a large change in the way the web developer community is able to submit feedback and influence both standards bodies and specifications. By lowering the barrier of entry to having suggestions and issues about current implementations heard, we hope to encourage more developers with an interest in dealing with standards bodies and browser vendors an opportunity to participate in the process.

The jQuery Standards Team is driven by jQuery team members Yehuda Katz and Paul Irish who some of you may know. Yeuhda and Paul have extenstively worked with standards bodies and browser vendors in a number of capacities over the years, with their individual work on SproutCore and Chrome Developer Relations providing them additional perspectives that will be useful when advocating for the community.

You may be wondering why we feel this team deserves to represent the wider web developer community. Because jQuery is used by such a large percentage of sites on the web (over 50% of the top 10,000 sites), we have a good feel for what problems and challenges are commonly faced and what issues with existing implementations we need to try working around. As jQuery is also so focused on DOM-manipulation, the library offers a good source of information for known implementation issues and their (current) best solutions.

Although the current team is primarily composed of jQuery team members, we want to get as many developers passionate about standards and specifications involved with the team as possible. At the end of the day, the team’s goal is to to help identify web developers interested in the process and give us all a forum for both discussing the process, ideas and shared areas of concern. We believe that working together, we can all help build a better web.

Getting Involved

If you’re interested in getting involved with the jQuery Standards Team, the easiest way is to sign up for the Google Group. Similar to other jQuery sub-teams, there are going to be regular public meetings in #jquery-meeting on freenode (date TBA) to discuss how the team can be as effective as possible in promoting the needs of the web developer community.

You might have already seen Paul’s post What feature would improve the web? — if your feedback was captured there, you’ve already gotten involved. ;)

You can also report (or comment) on standard or specification issues in the issue tracker on the official team Github repo. If you’re posting new issues, try to identify problems with specs or standards that either exist or are currently being proposed. Here’s a great example of one such issue.

We want to collect well-specified and articulated issues with the web ecosystem and advocate for improvements with the standards bodies or vendors. For genuine issues, we’ll tag them accordingly (eg. W3C, TC39, Browser-vendor etc.) and if applicable, file tickets with the appropriate standards groups or browser vendors so you don’t have to.

Conclusions

By creating this new forum we hope to give a voice to the millions of web developers interested in contributing to the process, but without an easy way to do so. Please let us know what your thoughts are about the team as we want to improve it as much as possible. We look forward to hearing your comments, suggestions and ideas about both it and the standards process!

jQuery 1.7 Beta 2 Released

Posted on by

Hot off the momentum of the jQuery Conference in Boston earlier this month, and based on the community’s valuable feedback, we’re releasing a new beta that incorporates further fixes and improves stability. The full list of fixes and features can be found below. We urge everyone to start testing this code in their applications, so we can make sure that there are no major problems before the final release.

You can get the code from the jQuery CDN:

Please help us by dropping that code into your existing application. If you see something, say something. File a bug and mention that you’re testing against jQuery 1.7 Beta 2. If there’s a problem we want to fix it!

jQuery 1.7 Beta 2 Change Log

The current change log of the 1.7 Beta 2 release:

Ajax

  • #9399: Deprecate jqXHR.success and jqXHR.error

Attributes

  • #5479: removeAttr: remove multiple attributes
  • #10176: Injected script tag is evaluated twice
  • #10278: checkboxEl.attr(‘checked’) returns stale value after checkboxEl.click()
  • #10429: IE7 – invalid procedure call or argument when calling removeAttr(‘contenteditable’);

Core

  • #6485: Solution for HTML5 in IE
  • #7102: Register jQuery as a CommonjS async module
  • #9453: $.inArray does not support fromIndex
  • #10478: Switch jQuery.isNaN to jQuery.isNumeric

Css

  • #10267: IE8 and window is(‘:visible’) crashes

Data

  • #7323: Allow removing multiple data keys at once with $.fn.removeData
  • #8909: $(element).data() will scan all attributes more than needed.
  • #8921: jQuery private data should stay private

Deferred

  • #8856: Request: deferred.isUnresolved()
  • #9033: try{ } finally{ } error in IE8
  • #9398: Proposal for Improved Deferreds

Dimensions

  • #9434: .outerWidth()/.outerHeight()/.innerWidth()/.innerHeight() should work on window and document

Effects

  • #5684: Effects: exception in animation callback causes endless loop
  • #6150: .stop sometimes doesn’t clear .delay
  • #6641: Calling stop() within animation finished callback causes other animations to freeze
  • #8685: Animations should keep track of animation state in order to properly address stacked animations
  • #9280: Allow multiple effect queues for animate()
  • #9548: animate does not work with fill-opacity css property for svg elements
  • #10416: defaultDisplay returns block instead of table-row for a tr in FF
  • #10445: Setting queue to true causes an error

Event

  • #3368: event.metaKey should be assigned to event.ctrlKey on Non-Mac only
  • #6170: jQuery(window).scroll(); causes IE* to scroll to 0,0
  • #6319: Regression: stopPropagation inside change handlers in IE is incorrectly applied to keydown event
  • #6386: support data argument for live events via “event.special.live.add”
  • #6593: IE8: DOM 0 event handler called twice when a separate handler is attached via jQuery
  • #6667: submit event doesn’t delegate in IE* under certain conditions
  • #6903: special events need a way to determine whether they are being bound with .bind vs .live/.delegate
  • #6942: JQuery.event.fix causes unnecessary reflows in IE when handling key events
  • #7139: “hover” event alias should work for .bind as well as .live
  • #7161: Submit event on a form element not unbound properly in IE
  • #7444: Submitting form with “Enter” instead of button click on ie8 or ie7 triggers live submit event twice.
  • #8157: Focusing an already focused text field will prevent the change event from firing in IE
  • #8728: Event ‘mouseenter’ not firing when the element being left is removed on leaving
  • #8789: Meta: Event Property Hooks
  • #8858: Special events – _default method doesn’t have access to the `data` argument of the trigger method
  • #8866: IE8 input[type=file] delegated change event files only on blur
  • #8982: bind(“unload someOther”) => on unload, handler is not executed only once.
  • #9069: when hover over a child of an element, mouseleave fires when using live or delegate
  • #9279: delegate() bind does not handle mouseover/mouseout and mouseenter/mouseout correctly for selected elements
  • #9393: Unify and DRY out event system
  • #9593: Delegated submit event is not instanceof jQuery.Event in IE
  • #9724: Infinite loop in trigger function when window.parentNode is a DOM element
  • #9901: event.handleObj.namespace incorrect when using .delegate
  • #9933: jQuery.fn.toggle() should store state in private data object
  • #9951: Wrong order in .trigger() when DOM is modified in a handler
  • #10375: Do not include `type` in jQuery.event.props
  • #10438: Rename jQuery.event.propHooks => .fixHooks
  • #10468: Remove deprecated jQuery.event.guid and jQuery.event.proxy
  • #10489: Disconnected elements bubble to window on .trigger()

Manipulation

  • #6782: carefully allow more strings to use innerHTML
  • #7037: Duplicate mouseover and mouseout events added to cloned element.

Selector

  • #3144: Inconsistent cross-browser results from .text() method
  • #5637: Boolean (and Empty) Attribute Selectors Fail
  • #6863: faster getText
  • #7128: attribute selector is inconsistent between qSA and Sizzle due to use of DOM properties
  • #8539: Sizzle cache collision in browsers without querySelectorAll
  • #9261: Has Attribute not working in filter/children/siblings
  • #9570: Selector $(‘form[name=".."]‘) returns zero elements in IE8 under some conditions
  • #10178: $(window).is(“a”) >> Uncaught TypeError: Cannot call method ‘toLowerCase’ of undefined
  • #10315: Sizzle ignores seed argument when using positional selectors

Support

  • #5145: jQuery.support.opacity = false in the Chrome browser
  • #6809: Add jQuery.support.fixedPosition

Traversing

  • #10449: Function $(“#id”).closest(“.class”) returns element $(“#id”) itself if it has .class

jQuery 1.7 Beta 1 Released

Posted on by

If you hadn’t heard, jQuery Conference 2011 is taking place in Boston later this week. We’ve put together a little something we like to call jQuery 1.7 Beta 1 that we’ll be talking a lot more about at the conference. It’s got a lovely bunch of new features and significant bug fixes–more than 50 of them at last count.

You can get the beta from the jQuery CDN:

Please help us by dropping this code into your existing application and letting us know if anything no longer works. Please file a bug ticket and be sure to mention that you’re testing against jQuery 1.7 BETA 1.

Also be sure to explore all the new features and see if your favorite pet-peeve bug has been fixed. If you wait until the final release to do your testing it will be too late!

As always, we want to encourage everyone from the community to try and get involved in contributing back to jQuery core. We’ve set up a full page of information dedicated towards becoming more involved with the team. The team is here and ready to help you help us!

Oh, you probably want to know what changed, right? Addy Osmani has made a great start with his recent post, so let’s cover the stuff that isn’t on his list.

New Event APIs: .on() and .off()

Over time, jQuery has evolved three ways to attach events to elements: .bind() , .live(), and .delegate(). Underneath it all, though, the three event APIs call the browser’s event system; that can lead to surprising interactions. For example, $(document).unbind("click") will remove all .live("click", ...) events, since those delegated events are attached to document. (This is also why you should use event namespaces.)

Our current event APIs aren’t going away soon, but to address the inconsistencies we’ve introduced a new and simple pair of event methods that can do the work of all three:

    $(elems).on(events, selector, data, fn);
    $(elems).off(events, selector, fn);

If a selector is provided, it’s a delegated event; otherwise it’s directly bound. All the features of the old APIs are there; for example events can be a space-separated string of event names and/or namespaces, or it can be an object where the keys are events and the values are event handler functions. Here are some examples of how the old methods map into the new ones:

Old API New API
$(elems).bind(events, fn) $(elems).on(events, fn)
$(elems).bind(events, { mydata: 42 }, fn) $(elems).on(events, { mydata: 42 }, fn)
$(elems).unbind(events, fn) $(elems).off(events, fn)
$(elems).delegate(selector, events, fn) $(elems).on(events, selector, fn)
$(elems).undelegate(selector, events, fn) $(elems).off(events, selector, fn)
$(selector).live(events, fn) $(document).on(events, selector, fn)
$(selector).die(events, fn) $(document).off(events, selector, fn)

Form Change and Submit Events in IE 6/7/8

These old Internet Explorer versions are likely to be haunting us for some time, so we’ve spent a while trying to improve their behavior. Event delivery performance has been greatly improved for them, but the biggest change is that we are using a different approach to fix their non-bubbling and broken form events. As a result we were able to greatly simplify and shorten the special events code. These events should work without any problems–even better than before, since we closed about a half-dozen related bugs–but please keep your eyes open for any unusual behavior.

Animation Improvements

Before version 1.7, if you stopped an animation before it completed it could create a situation where the element being animated would never return to its full size; it would essentially be stuck at the height that it was when the animation was stopped. We’ve fixed that by remembering the original dimensions before the animation starts so that they can be used later. This eliminates a major annoyance in using certain animations, particularly toggling ones.

.removeData() Enhancements

Addy mentioned this one as well, but the .removeData() API now lets you pass either a space-separated string of names or an array of names to be removed. Since spaces were previously allowed in data names, the code first checks for the exact name as you specified it before splitting the string on spaces. That way, no existing code should break as a result of this enhancement.

jQuery 1.7 BETA 1 Change Log

Here is a complete list of changes made for the 1.7 BETA 1 release.

Ajax

  • #9399: Deprecate jqXHR.success and jqXHR.error

Attributes

  • #5479: removeAttr: remove multiple attributes
  • #10278: checkboxEl.attr(‘checked’) returns stale value after checkboxEl.click()

Core

  • #6485: Solution for HTML5 in IE
  • #7102: Register jQuery as a CommonjS async module
  • #9453: $.inArray does not support fromIndex

Css

  • #10267: IE8 and window is(‘:visible’) crashes

Data

  • #7323: Allow removing multiple data keys at once with $.fn.removeData
  • #8909: $(element).data() will scan all attributes more than needed.
  • #8921: jQuery private data should stay private

Deferred

  • #8856: Request: deferred.isUnresolved()
  • #9033: try{ } finally{ } error in IE8
  • #9398: Proposal for Improved Deferreds

Effects

  • #5684: Effects: exception in animation callback causes endless loop
  • #6150: .stop sometimes doesn’t clear .delay
  • #6641: Calling stop() within animation finished callback causes other animations to freeze
  • #8685: Animations should keep track of animation state in order to properly address stacked animations
  • #9280: Allow multiple effect queues for animate()
  • #9548: animate does not work with fill-opacity css property for svg elements

Event

  • #3368: event.metaKey should be assigned to event.ctrlKey on Non-Mac only
  • #6170: jQuery(window).scroll(); causes IE* to scroll to 0,0
  • #6319: Regression: stopPropagation inside change handlers in IE is incorrectly applied to keydown event
  • #6386: support data argument for live events via “event.special.live.add”
  • #6593: IE8: DOM 0 event handler called twice when a separate handler is attached via jQuery
  • #6667: submit event doesn’t delegate in IE* under certain conditions
  • #6705: focus() causes focus event to be handled twice in IE8
  • #6903: special events need a way to determine whether they are being bound with .bind vs .live/.delegate
  • #6942: JQuery.event.fix causes unnecessary reflows in IE when handling key events
  • #7139: “hover” event alias should work for .bind as well as .live
  • #7161: Submit event on a form element not unbound properly in IE
  • #7444: Submitting form with “Enter” instead of button click on ie8 or ie7 triggers live submit event twice.
  • #8157: Focusing an already focused text field will prevent the change event from firing in IE
  • #8728: Event ‘mouseenter’ not firing when the element being left is removed on leaving
  • #8789: Meta: Event Property Hooks
  • #8858: Special events – _default method doesn’t have access to the `data` argument of the trigger method
  • #8866: IE8 input[type=file] delegated change event files only on blur
  • #8982: bind(“unload someOther”) => on unload, handler is not executed only once.
  • #9069: when hover over a child of an element, mouseleave fires when using live or delegate
  • #9279: delegate() bind does not handle mouseover/mouseout and mouseenter/mouseout correctly for selected elements
  • #9393: Unify and DRY out event system
  • #9593: Delegated submit event is not instanceof jQuery.Event in IE
  • #9724: Infinite loop in trigger function when window.parentNode is a DOM element
  • #9901: event.handleObj.namespace incorrect when using .delegate
  • #9933: jQuery.fn.toggle() should store state in private data object
  • #9951: Wrong order in .trigger() when DOM is modified in a handler

Manipulation

  • #6782: carefully allow more strings to use innerHTML
  • #7037: Duplicate mouseover and mouseout events added to cloned element.

Selector

  • #5637: Boolean (and Empty) Attribute Selectors Fail
  • #7128: attribute selector is inconsistent between qSA and Sizzle due to use of DOM properties
  • #9261: Has Attribute not working in filter/children/siblings
  • #9570: Selector $(‘form[name=".."]‘) returns zero elements in IE8 under some conditions
  • #10178: $(window).is(“a”) >> Uncaught TypeError: Cannot call method ‘toLowerCase’ of undefined
  • #10315: Sizzle ignores seed argument when using positional selectors

Support

  • #6809: Add jQuery.support.fixedPosition

Just Added: HTML5 Training at jQuery Conference Boston!

Posted on by

Update: For the first time ever, we have a conference signage sponsor. Thanks to custom signs shop Signazon for your support.


The Boston conference is sold out (thanks everyone!), as is the Intro to jQuery training session, but the requests keep coming! In response to popular demand, we’ve added a second training scheduled for Friday, September 30th.

The training will focus on HTML5, and be taught by jQuery Core Team Member and Bocoup trainer Richard Worth. The price will be the same $299 (which, if you’ve been paying attention to HTML5 training rates, is a steal!).

Here’s some detail from the training description:

HTML5 is the next major milestone in HTML and it’s not just another incremental enhancement; it represents an enormous advance for modern web applications. A large number of HTML5 features are already supported in browsers, so it’s time to start using them!

In our HTML5 for Programmers Workshop, you will learn how to create HTML5 web pages and web applications using semantic HTML5 markup and cross-browser HTML5 JavaScript APIs. After completing this course, students will:

  • Know how to use semantic HTML5 Markup
  • Know how to use cross-browser HTML5 JavaScript APIs
  • Understand current browser support for the various HTML5 features
  • Understand how to polyfill HTML5 features on older browsers

Our training takes a step-by-step approach, solidifying fundamental concepts and building on them to leave each attendee with a more thorough understanding of HTML5. Using a 50% lecture / 50% lab format, attendees will be able to put the concepts they have just learned to use after each section.

  • HTML5 Overview
  • Using HTML5 Today
  • Markup
  • Forms
  • Canvas
  • Video and Audio
  • Drag and Drop
  • Geolocation
  • Web Storage
  • Web Workers
  • Communication and Web Sockets

This course is designed for software developers interested in designing, creating, and deploying HTML5 web applications. It is valuable to developers that already have experience in developing web applications. To get the most out of the course, you should be familiar with HTML, CSS, and JavaScript.

Prior exposure to any of these concepts will be helpful, but not required: AJAX, XML, jQuery, HTTP, REST.

It’s short notice, but we hope you can make it, so register now! As always, feel free to email [email protected] with any event related questions.

See you all at the show!

jQuery 1.6.4 Released

Posted on by

jQuery 1.6.4 Released

This is a minor point release of jQuery. We’re releasing it fix a couple issues that came up during the release of jQuery 1.6.3.

You can get the code from the jQuery CDN:

You can help us by dropping that code into your existing application and letting us know that if anything no longer works. Please file a bug and be sure to mention that you’re testing against jQuery 1.6.4.

We want to encourage everyone from the community to try and get involved in contributing back to jQuery core. We’ve set up a full page of information dedicated towards becoming more involved with the team. The team is here and ready to help you help us!

jQuery 1.6.4 Change Log

The current change log of the 1.6.4 release.

Data

  • #10194: Data attribute names with single dash-surrounded letters cannot be accessed by the camel-case name

Event

  • #10208: $(“form”).live(“submit”, fn) not fired from <button type=”submit”> in IE8

Support

  • #10197: Bug with mime-type application/xhtml+xml in jquery 1.6.3

jQuery 1.6.4 RC1 released

Posted on by

jQuery 1.6.4 will be released soon, and we need your help with this release candidate to find any remaining bugs. We’re putting out a new version to address a few last-minute bugs that crept into the 1.6.3 release. With version 1.7 coming next month, we felt it was important to fix these bugs and finalize the 1.6.x line before making more extensive changes and feature additions.

Feel free to do your testing by including either one of these files (one minified and one uncompressed). If you find any important differences from 1.6.3, please file a bug as soon as possible and be sure to mention that you’re testing against jQuery 1.6.4 RC1. Our preferred venue for test cases is jsFiddle; you can just use the “jQuery (edge)” selection there.

jQuery 1.6.4 RC1 Change Log

The current change log of the 1.6.4 release:

Data

  • #10194: Data attribute names with single dash-surrounded letters cannot be accessed by the camel-case name

Event

  • #10208: $(“form”).live(“submit”, fn) not fired from <button type=”submit”> in IE8

Support

  • #10197: Bug with mime-type application/xhtml+xml in jquery 1.6.3

Please do file a bug report with a test case as soon as possible if you find problems, as described above. Blog comments or Twitter aren’t helpful bug reports!