Considering this result I get from an ajax call:
[
{
"field1": "2381",
"field2": "1233",
"field3": "43.79489333333333",
"field4": "11.22697833333333"
},
{
"field1": "2381",
"field2": "1774",
"field3": "45.70752833333334",
"field4": "9.489278333333333"
}
]
and having an ajax call it keeps returning "unexpected character" error and I have this kind of call I use:
jQuery.ajax({
type: "GET",
dataType: "json",
url: "/myUrl.php",
success: function(data) {
console.log(data);
var arrayObjects = JSON.parse(data);
}
});
So since I read on the internet this kind of ajax calls, it says:
[{"value": "test"}] is valid
So I wonder why my object keeps returning "unexpected character".