ajax解析json值

$.ajax({
async: true,
type: "post",
url: "${ctxPath!}/pc/xxx/json?id=" + id,
dataType: "json",
success: function (data) {
$("#shi").empty();
$.each(data.listcity, function (i, item) {
var text = "<li onclick=\"drop(this)\">" + item.cityName + "</li>";
$("#shi").append(text);
})
$("#shi").append(" <i class=\"clear\"></i>");
}
})

猜你喜欢

转载自www.cnblogs.com/zhangyong0908/p/9218275.html