$(function () { $.ajax({ type: "POST", dataType: "json", url: "da.json", success: function (result) { var str = ""; $.each(result,function(index,obj){ str += "" + obj["img"] + ""; }); $("#ok").append(str); } }); });
js读json文件
$(function () { $.ajax({ type: "POST", dataType: "json", url: "da.json", success: function (result) { var str = ""; $.each(result,function(index,obj){ str += "" + obj["img"] + ""; }); $("#ok").append(str); } }); });