63
rated 0 times
[
65]
[
2]
/ answers: 1 / hits: 39372
/ 11 Years ago, fri, january 10, 2014, 12:00:00
How can i access this response from server using javascript.
This is the json encoded data.
[{cid:1234,city:value1,district:value2,state:value3}]
Thanks in advance.
This is the ajax code:
function cityauto(ctid){
var city = document.getElementById(ctid);
if(city.value.length > 3){
$.ajax({
type: GET,
url: city.php,
data: {term: city.value},
success: function (data){
alert(data);
}
});
}
Html code:
<input type=text name=city id=cty onblur=cityauto(this.id); />
onblur i am getting above response from php file in alert box now i need to access that values in javscript.
More From » javascript