I want to know how I can correctly return the data from the following json: pretend i have a url http://test.com/tesdata which gives me the following data:
[{"Identifier":1, "Name":"Test"},
{"Identifier":2, "Name":"Test"},
{"Identifier":3, "Name":"Test"}]
So I did the following to get this data in a div:
$.ajax({
type: 'GET',
url: 'http://notgiven',
data: { get_param: 'value' },
dataType: 'json',
success: function (data) {
alert("s");
$.each(data, function(index, element) {
$('.result').append("a");
});
},
error: function(jqXHR, textStatus, errorThrown){
alert("jqXHR: " + JSON.stringify(jqXHR));
alert("textStatus: " + JSON.stringify(textStatus));
alert("errorThrown: " + JSON.stringify(errorThrown));
}
});
And i get the following error Unable to parse Json string