{ "programmers": [
{ "firstName": "Brett", "lastName":"McLaughlin", "email": "aaaa" },
{ "firstName": "Jason", "lastName":"Hunter", "email": "bbbb" },
{ "firstName": "Elliotte", "lastName":"Harold", "email": "cccc" }
],
"authors": [
{ "firstName": "Isaac", "lastName": "Asimov", "genre": "science fiction" },
{ "firstName": "Tad", "lastName": "Williams", "genre": "fantasy" },
{ "firstName": "Frank", "lastName": "Peretti", "genre": "christian fiction" }
],
"musicians": [
{ "firstName": "Eric", "lastName": "Clapton", "instrument": "guitar" },
{ "firstName": "Sergei", "lastName": "Rachmaninoff", "instrument": "piano" }
] }
<form action="form_action.json" method="get">
<p>First name: <input type="text" name="fname" /></p>
<p>Last name: <input type="text" name="lname" /></p>
<input type="submit" value="Submit" />
</form>
4 回答

宝慕林4294392
TA贡献2021条经验 获得超8个赞
var list=JSON.Parse(json);
for(var i=0;i<list.length;i++){
var $li = $('<li title="'+list[i].title+'"><img style="height:'+list[i].height+'px;width:'+list[i].width+'px;" src="'+list[i].image+'"/></li>');
$('ul').append($li);
}
添加回答
举报
0/150
提交
取消