Ticket #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: | ||
| Blocking: | Blocked by: |
Description (last modified by jitter) (diff)
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
comment:1 Changed 2 years ago by jitter
- Priority changed from undecided to low
- Component changed from unfiled to ajax
- Description modified (diff)
comment:2 Changed 2 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.
comment:3 follow-up: ↓ 4 Changed 2 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 2 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
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
