Bug Tracker

Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#8118 closed bug (invalid)

ajax datatype json acts as jsonp for jquery 1.5

Reported by: [email protected] Owned by: [email protected]
Priority: low Milestone: 1.next
Component: ajax Version: 1.5
Keywords: Cc:
Blocked by: Blocking:

Description (last modified by jitter)

used jquery.autocomplete which added $.ajax{dataType:"json"} which results in query adds jsonp callback and further the callback will cause a parse error, when removing the dataType spec. will cause correct behavior. In my scenario the response data structure is => [{"someproperty":"somevalue"}, {"someproperty":"somevalue"}]

Did a quick search for json in jquery-1.5.js and found this on row 6905:

// Detect, normalize options and install callbacks for jsonp requests
jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, dataIsString /* internal */ ) {

removing the "json" from first argument will add correct behavior when spec. dataType:"json"

Change History (5)

comment:1 Changed 12 years ago by jitter

Component: unfiledajax
Description: modified (diff)
Priority: undecidedlow

comment:2 Changed 12 years ago by jitter

Owner: set to [email protected]
Status: newpending

Thanks for taking the time to contribute to the jQuery project by writing a bug report.

Please submit a reduced test case, which reproduces the issue you are experiencing, on http://jsfiddle.net. So that we can investigate this issue further.


How to report bugs

comment:3 Changed 12 years ago by john.firebaugh

Are you using the jquery-validation plugin? It is not compatible with jQuery 1.5 and in particular causes the symptom you describe.

https://github.com/jzaefferer/jquery-validation/issues#issue/36

comment:4 in reply to:  3 Changed 12 years ago by [email protected]

Status: pendingnew

Yes, that is correct. I removed jquery-validation from loading and it makes things work. You can close this issue.

Thanks, Daniel

Replying to john.firebaugh:

Are you using the jquery-validation plugin? It is not compatible with jQuery 1.5 and in particular causes the symptom you describe.

https://github.com/jzaefferer/jquery-validation/issues#issue/36

comment:5 Changed 12 years ago by jaubourg

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.