这是我的 Json 响应格式:-
{"Value":[{"ID":"1","productID":"10","subsID":"9","MinPrice":"500","MaxPrice":"50000","Subs":"xyz100"}]}
这是我的 .js 代码:-
function productURL(url) {
alert(url);
$.ajax({
url: url,
type : "GET",
dataType : "json",
contentType: "application/json",
async : false,
success : function(msg) {
var respPrice = msg.Value;
$.each(respPrice, function(index, value) {
if(value.VarietyID == 0) {
alert('No product subs list found');
} else {
subsId = value.subsID;
substance = value.subs;
minPrice = value.MinPrice;
maxPrice = value.MaxPrice;
respPrice += '<li class="ui-btn ui-btn-icon-right ui-li-has-arrow ui-li ui-last-child ui-btn-up-e">' + substance + minPrice + '-' + maxPrice + '</li>';
};
}
});
$('#productList').append(respPrice).listview('refresh');
},
error : function(e) {
console.log(e.message);
alert('Error Occoured');
}
});
}
我需要做哪些修改才能正确生成 listview ?任何帮助将不胜感激。