11 week

1.My Json(部分实例)

var txt = '{ "sites" : [' +

{ "name":"彩铅" , "url":"www.....com" },
{ "name":"素描" , "url":"www.....com" },
{ "name":"抽象画" , "url":"www.....com" }

{ "name":"唱歌" , "url":"www.....com" },
}

var obj = eval ("(" + txt + ")");
document.getElementById("name").innerHTML=obj.sites[0].name
document.getElementById("url").innerHTML=obj.sites[0].url

 

......

posted @ 2018-11-18 22:28  linlinlina  阅读(105)  评论(0编辑  收藏  举报