90
rated 0 times
[
92]
[
2]
/ answers: 1 / hits: 24301
/ 13 Years ago, fri, august 12, 2011, 12:00:00
I have a web page that returns this JSON when called:
[{id:53,desc:Roberts}]
I am using this jQuery to call it by AJAX:
$.ajax ({
url: rootPath + data/topology/stations,
dataType: 'json',
data: { areaID: $(#lbxArea).val () },
success: function (data) {
// Use data for actions
},
error: function (jqXHR, textStatus, errorThrown) {
alert (textStatus);
alert (errorThrown);
}
});
I used Firebug to confirm that the data being returned is what I put on top. Despite that, I fall into the error
callback and first see parsererror
in an alert box, and then I see
SyntaxError: JSON.parse: expected property name or '}'
I tried having the service return
{list:[{id:53,desc:Roberts}]}
but that didn't change anything.
More From » jquery