#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: | ||
Blocked by: | Blocking: |
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 (4)
comment:1 Changed 12 years ago by
Component: | unfiled → ajax |
---|---|
Owner: | set to rhoffman |
Priority: | undecided → low |
Status: | new → pending |
comment:2 Changed 12 years ago by
Status: | pending → 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
comment:3 Changed 12 years ago by
Resolution: | → duplicate |
---|---|
Status: | new → closed |
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.