jQuery.parseJSON returning empty data structure-Collection of common programming errors

I am having a perplexing issue with data manipulation in JavaScript.

I am using the following code in JavaScript to retrieve data from a PHP/MySQL source.

var _response = jQuery.ajax({
    url: "../data",
    async: false,
    type: "post",
    data: oParams
}).responseText;

and have confirmed that the contents of _response are

_response = '{"genus":["Some Data"],"series":[],"program":["Some Data1","Some Data2","Some Data3"]}';

However when doing the following:

var _return = jQuery.parseJSON( _response );
console.log( _return );

I end up with:

genus: [""]
program: ["", "", ""]
series: []

according to firebug. I have even gone as far as to put the string directly into jQuery.parseJSON() and log the result and still end up with an empty data structure.

Does anyone know what is going on here or what would cause this?

  1. There must be something wrong either with your jQuery file or your browser. It works fine for me in jQuery 1.7.1:

    > var x = $.parseJSON('{"genus":["Some Data"],"series":[],"program":["Some Data1","Some Data2","Some Data3"]}');
    undefined
    > x["genus"]
    ["Some Data"]
    

Originally posted 2013-11-10 00:14:16.