Ajax如何读取Json数据 20
假设我从服务器接受到的数据是[{author:'JackHerrington',title:'CodeGenerationinAction'},{author:'Jack...
假设我从服务器接受到的数据是
[
{ author: 'Jack Herrington', title: 'Code Generation in Action' },
{ author: 'Jack Herrington', title: 'Podcasting Hacks' },
{ author: 'Jack Herrington', title: 'PHP Hacks' }
]
然后我应该如何循环输出author和title 的内容 展开
[
{ author: 'Jack Herrington', title: 'Code Generation in Action' },
{ author: 'Jack Herrington', title: 'Podcasting Hacks' },
{ author: 'Jack Herrington', title: 'PHP Hacks' }
]
然后我应该如何循环输出author和title 的内容 展开
1个回答
展开全部
<script>
var json=[
{ author: 'Jack Herrington', title: 'Code Generation in Action' },
{ author: 'Jack Herrington', title: 'Podcasting Hacks' },
{ author: 'Jack Herrington', title: 'PHP Hacks' }
]
alert(json[0].title)
</script>
var json=[
{ author: 'Jack Herrington', title: 'Code Generation in Action' },
{ author: 'Jack Herrington', title: 'Podcasting Hacks' },
{ author: 'Jack Herrington', title: 'PHP Hacks' }
]
alert(json[0].title)
</script>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询