i haven't found response on differents post about that's problem ...
i call a servcie who returns a json data, the code works fine on localhot but don't work online...
my success method :
if (data !== null) {
var _summoners = jQuery.parseJSON(data);
var keys = Object.keys(_summoners);
for (var i = 0; i < keys.length; i++) {
console.log(keys[i]);
$("." + keys[i]).text(_summoners[keys[i]]);
};
}
and the data returned :
{
"45260330": "SharkMister",
"42215171": "Nietpopov",
"40247365": "emaki",
"49678659": "FakeThePump",
"42127891": "Nutty Trickster",
"45397483": "Enter Name Here1",
"26589510": "pedrocsi",
"23324155": "Abdi385",
"46217784": "ExpliciitA",
"37018042": "GabrikageBR"
}
i can't find my mistake, any idea ?
NB : i set the dataType
on my ajax call to 'json'
and my returns headers is:
Accept application/json, text/javascript, */*; q=0.01
And the exact error is :
SyntaxError: JSON.parse: unexpected character
var _summoners = jQuery.parseJSON(data);
The returns type object is a string well formated...