I am able to make a Ajax request and getting response as well in form of JSON string, still alert box of JavaScript is not showing actual response text. I am new to ajax concept and dont know much.
Ajax-Call:-
Action triggered on dropdown
<select name="state" onchange="getOptions(this.value)">
Javascript Function called :-
function getOptions(state){
AJAX.onreadystatechange = handler;
AJAX.open("GET", "getData?id="+state);
AJAX.send();
};
Response Firebug is showing

This is my code to fetch response and print.
function handler() {
if(AJAX.readyState == 4 && AJAX.status == 200) {
var json = eval('(' + AJAX.responseText +')');
alert('Success. Result:' + json);
}
else if (AJAX.readyState == 4 && AJAX.status != 200) {
alert('Something went wrong...');
}
}
Every time its a success but i get output as

var res=JSON.parse(AJAX.responseText); alert(res.name)...It will alertDehradunres[0].name.. whereres[0]is the first object in array got afterJSON.parse(AJAX.responseText)