$.ajax({
type: “GET”,
datatype: “‘json’,
url: ‘/try/retr’,
success: function(data){
var obj = JSON.parser(data)
alert(obj.data)
}
});
This code gave the error:
Uncaught SyntaxError: Unexpected token o
Error is once declared as datatype json, it parses for you.
so :
var obj = JSON.parser(data)
success: function(data){
var obj = JSON.parser(data)
alert(obj.data)
}
and bingo
Reblogged this on Sutoprise Avenue, A SutoCom Source.