JQuery 1.9.ajax () datatype default changed?

Given an ajax call, for example:

$.ajax(
{
    url:"MyWebService.blah",
    data: {"data":"awesome"},
    success : function(responseText)
    {
       var myJsonObj = $.parseJSON(responseText);
       //do stuff with myJsonObj
    }
});

This worked fine. I upgraded jQuery to 1.9 today (I was at 1.6 for a while) as a possible fix for Safari suddenly not supporting various switching functions (something about eventLayer.X no longer supported), and now all my ajax calls throw the following javascript error:

Uncaught Syntax Error: Unexpected token o

After a little research and some testing, I found that the "responseText" in my code above is a JSON object, not a string. So the error makes sense, but I'm trying to circle my head around it. Has jQuery really changed the default return type? I checked the documentation:

http://api.jquery.com/jQuery.ajax/

dataType - "Intelligent Guess". , , .

, :

  • (ish) jQuery?
  • 1.9, , - , 1.6?
  • " " ?

, . JSON, . , ? , dataType , , ... . , - jQuery?

+5
1

jQuery , , , . , 1.9 , , json. , .

+6

All Articles