I am trying to get out a JSON object, but I end up with getting all the HTML as well.
alert("5 " + request.responseText);
var JSONObject = eval( + "(" + request.responseText + ")" );
alert("text1: " + JSONObject.name);
So, the first line prints pure html code in an alert. Is it supposed to do that, or is the responseText supposed to only be the JSON Object?
The second line does not work, so the third line doesn't print.
I've seen examples where they just use eval on the responseText as I do, but in my case it doesn't work... Any suggestions?
request.responseTextis HTML, it cannot beevaled into an object..