I have this code:
GameManager.prototype.initGame = function () {
var api = 'my_url';
$.ajax({
url : api,
type : 'POST',
data: "",
dataType : 'json',
success : function(data) {
alert(data);
}
});
};
I see in the Firebug console the JSON:
[{"data":{"score":500,"token":"2896c5380bf3e3e29467258c7fe885fe"}}]
But the alert(data) shows me [object Object].