New member
- Joined
- Feb 14, 2023
- Messages
- 10
- Thread Author
- #1
I return a array object data Ajax success result then i print li tag but its show undefind
My Ajax code is
here i alert the jsdata i get result like
but the li list show undefind, How to solve this issue..
please help me to solve this issue
My Ajax code is
Code:
$.ajax({
'method': 'GET',
'url': base_url +'party/selectCities?id='+state,
success: function(data) {
var newData = data.replace(/\"/g, "")
if(newData == ""){
}else{
var datas = JSON.stringify(newData);
var jsdata = JSON.parse(datas);
alert(jsdata);
var html = ``;
for(var i = 0; i<jsdata.length; i++){
html += '<li ng-click="selectcityclubs(' + jsdata[i].city+ ');>' + jsdata[i].city+ '</li>';
}
$("#ClubCity").html(html);
}
}
});
here i alert the jsdata i get result like
Code:
[{city:North Goa},{city:South Goa}]
please help me to solve this issue