From 65851005d20ad2cc035eccf665ce37ffd6c76703 Mon Sep 17 00:00:00 2001 From: Rick Waldron Date: Thu, 21 Oct 2010 16:36:22 -0400 Subject: [PATCH 1/4] Fixes Problem at line 1279 character 22 data is already defined. --- src/data.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/data.js b/src/data.js index 31cdc121e9..3112c22dc9 100644 --- a/src/data.js +++ b/src/data.js @@ -134,11 +134,13 @@ jQuery.extend({ jQuery.fn.extend({ data: function( key, value ) { + + var attr, data, name, parts; + if ( typeof key === "undefined" ) { - var data = null; if ( this.length ) { - var attr = this[0].attributes, name; + attr = this[0].attributes; data = jQuery.data( this[0] ); for ( var i = 0, l = attr.length; i < l; i++ ) { @@ -159,11 +161,11 @@ jQuery.fn.extend({ }); } - var parts = key.split("."); + parts = key.split("."); parts[1] = parts[1] ? "." + parts[1] : ""; if ( value === undefined ) { - var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); + data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); // Try to fetch any internally stored data first if ( data === undefined && this.length ) { From bc282a887ef6a71036f04112fa72adec383d7e0e Mon Sep 17 00:00:00 2001 From: rwldrn Date: Fri, 22 Oct 2010 17:20:12 -0400 Subject: [PATCH 2/4] Fixes #7229 events with null handlers --- src/event.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/event.js b/src/event.js index fb5a3ef8cc..8b698f9a72 100644 --- a/src/event.js +++ b/src/event.js @@ -36,13 +36,13 @@ jQuery.event = { var handleObjIn, handleObj; - if ( handler.handler ) { + if ( handler && handler.handler ) { handleObjIn = handler; handler = handleObjIn.handler; } // Make sure that the function being executed has a unique ID - if ( !handler.guid ) { + if ( handler && !handler.guid ) { handler.guid = jQuery.guid++; } @@ -116,7 +116,7 @@ jQuery.event = { handleObj.type = type; if ( !handleObj.guid ) { - handleObj.guid = handler.guid; + ( handleObj && handler ) && ( handleObj.guid = handler.guid ); } // Get the current list of functions bound to this event From 89850e9bea6c50f916d0e42fa713b59102203a9c Mon Sep 17 00:00:00 2001 From: rwldrn Date: Fri, 22 Oct 2010 18:56:22 -0400 Subject: [PATCH 3/4] Fixes issue #5803 --- src/ajax.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ajax.js b/src/ajax.js index a40e223e76..29e15b10d6 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -207,6 +207,12 @@ jQuery.extend({ if ( s.data && s.processData && typeof s.data !== "string" ) { s.data = jQuery.param( s.data, s.traditional ); } + + // If the jsonpCallback has been set, we can assume that dataType is jsonp + // Ticket #5803 + if ( s.jsonpCallback ) { + s.dataType = "jsonp"; + } // Handle JSONP Parameter Callbacks if ( s.dataType === "jsonp" ) { From a5f077500bfabc52764fed40aa373e9c7104c1da Mon Sep 17 00:00:00 2001 From: rwldrn Date: Fri, 22 Oct 2010 18:56:44 -0400 Subject: [PATCH 4/4] Fixes issue #7229 --- src/event.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/event.js b/src/event.js index 8b698f9a72..b3d1843c86 100644 --- a/src/event.js +++ b/src/event.js @@ -35,13 +35,15 @@ jQuery.event = { } var handleObjIn, handleObj; - + + // Fixes bug #7229. Evaluate handler before handler prop if ( handler && handler.handler ) { handleObjIn = handler; handler = handleObjIn.handler; } // Make sure that the function being executed has a unique ID + // Fixes bug #7229. Evaluate handler before handler prop if ( handler && !handler.guid ) { handler.guid = jQuery.guid++; } @@ -116,6 +118,7 @@ jQuery.event = { handleObj.type = type; if ( !handleObj.guid ) { + // Fixes bug #7229. Evaluate handler before handler prop ( handleObj && handler ) && ( handleObj.guid = handler.guid ); }