Thursday, June 2, 2011

jQuery v1.4 and live handlers on IE

This bug report explains why setting 'disabled' on elements through IE were not being disabled...works for elements that use bind() but not live()....it has been fixed since 1.5. It explains a lot why setting 'disabled' to work on Firefox/Chrome but still has issues on IE. Upgrading to 1.5/1.6 should resolve the issue, though the Ajax module has been completely rewritten to allow for chaining callback routines (see http://blog.jquery.com/2011/01/31/jquery-15-released/).

http://bugs.jquery.com/ticket/6911

jQuery 1.4.3:
function liveHandler( event ) {
 var stop, maxLevel, elems = [], selectors = [],
  related, match, handleObj, elem, j, i, l, data, close, namespace, ret,
  events = jQuery.data( this, this.nodeType ? "events" : "__events__" );

 if ( typeof events === "function" ) {
  events = events.events;
 }

 // Make sure we avoid non-left-click bubbling in Firefox (#3861)
 if ( event.liveFired === this || !events || !events.live || event.button && event.type === "click" ) {
  return;
 }

jQuery 1.5.2:
function liveHandler( event ) {
    var stop, maxLevel, related, match, handleObj, elem, j, i, l, data, close, namespace, ret,
        elems = [],
        selectors = [],
        events = jQuery._data( this, "events" );

    // Make sure we avoid non-left-click bubbling in Firefox (#3861) and disabled elements in IE (#6911)                                                                                                                                     
    if ( event.liveFired === this || !events || !events.live || event.target.disabled || event.button && event.type === "click" ) {
        return;
    }

No comments:

Post a Comment