Ticket #8940 (closed bug: duplicate)
$.getJSON does not use "text json" converter
| Reported by: | rhoffman | Owned by: | rhoffman |
|---|---|---|---|
| Priority: | low | Milestone: | 1.next |
| Component: | ajax | Version: | 1.5.2 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
I was previously using jQuery 1.4.x, and upgraded to 1.5.2. Some of my calls to .getJSON have stopped working. If I change the calls to a regular .get, and then in the first line of the callback run jQuery.parseJSON on the result, it works fine. After some debugging, I have determined that the problem is with the new jQuery AJAX converter system and the .getJSON convinence method. If it is changed from:
getJSON: function( url, data, callback ) {
return jQuery.get( url, data, callback, "json" );
},
to:
getJSON: function( url, data, callback ) {
return jQuery.get( url, data, callback, "text json" );
},
the problem is corrected.
Change History
comment:1 Changed 2 years ago by timmywil
- Owner set to rhoffman
- Priority changed from undecided to low
- Status changed from new to pending
- Component changed from unfiled to ajax
comment:2 Changed 2 years ago by rhoffman
- Status changed from pending to new
Unfortunately, I can not do this on jsfiddle, since this involves an HTTP GET request, and jsfiddle only supports POST requests.
Here is another blog post with another user that has this issue: http://documentsnotincluded.blogspot.com/2011/03/jquery-151-and-converters.html
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Thanks for taking the time to contribute to the jQuery project! Please provide a reduced test case on http://jsFiddle.net that reproduces the issue experienced to help us assess your ticket. Additionally, test against the jQuery (edge) version to ensure the issue still exists.