Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes Bug #7229 events with null handlers #64

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/ajax.js
Expand Up @@ -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" ) {
Expand Down
4 changes: 2 additions & 2 deletions src/data.js
Expand Up @@ -138,7 +138,7 @@ jQuery.fn.extend({

if ( typeof key === "undefined" ) {
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++ ) {
Expand All @@ -159,7 +159,7 @@ jQuery.fn.extend({
});
}

var parts = key.split(".");
parts = key.split(".");
parts[1] = parts[1] ? "." + parts[1] : "";

if ( value === undefined ) {
Expand Down
11 changes: 7 additions & 4 deletions src/event.js
Expand Up @@ -35,14 +35,16 @@ jQuery.event = {
}

var handleObjIn, handleObj;

if ( handler.handler ) {

// 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
if ( !handler.guid ) {
// Fixes bug #7229. Evaluate handler before handler prop
if ( handler && !handler.guid ) {
handler.guid = jQuery.guid++;
}

Expand Down Expand Up @@ -116,7 +118,8 @@ jQuery.event = {

handleObj.type = type;
if ( !handleObj.guid ) {
handleObj.guid = handler.guid;
// Fixes bug #7229. Evaluate handler before handler prop
( handleObj && handler ) && ( handleObj.guid = handler.guid );
}

// Get the current list of functions bound to this event
Expand Down