Bug Tracker

Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#8118 closed bug (invalid)

ajax datatype json acts as jsonp for jquery 1.5

Reported by: gudski@… Owned by: gudski@…
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 6 years ago by jitter

  • Component changed from unfiled to ajax
  • Description modified (diff)
  • Priority changed from undecided to low

comment:2 Changed 6 years ago by jitter

  • Owner set to gudski@…
  • Status changed from new to pending

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 follow-up: Changed 6 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 6 years ago by gudski@…

  • Status changed from pending to new

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 6 years ago by jaubourg

  • Resolution set to invalid
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.