Bug Tracker

Modify

Ticket #8940 (closed bug: duplicate)

Opened 2 years ago

Last modified 15 months ago

$.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

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.

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

comment:3 Changed 2 years ago by jaubourg

  • Status changed from new to closed
  • Resolution set to duplicate

comment:4 Changed 2 years ago by jaubourg

Duplicate of #8084.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.