?({"contentStr":"[{'title':'2016年雅思考试时间公布','shortTitle':'2016年雅思考试时间公布','titleImg':'http://hz.xhd.cn','url':'http://hz.xhd.cn/homecontent/huodongyugao/578882.html','description':'2016年雅思考试时间公布。英国文化教育协会正式公布2016年雅思考试日期。2016年雅思考试共设有48个考试日期,从即日起开始接受公开报名。'},{'title':'2016年托福时间表公布','shortTitle':'2016年托福时间表公布','titleImg':'http://hz.xhd.cn','url':'http://hz.xhd.cn/homecontent/huodongyugao/578883.html','description':'ETS教育部托福报名官网早早公布了中国大陆地区2016年托福考试时间表。下面杭州新航道小编就为大家整理了一下,准备报考的小伙伴们,赶快来看看!提前做好准备并且抢考位啦!'}]"})
2 回答

qq_冲哥_0
TA贡献40条经验 获得超30个赞
contentStr 这是一个对象的属性,如果你这么写,它的取值全都是字符串,要用字符串提取substring;
data.contentStr.substring(10,23)
要不要把contentStr 取值 的两个双引号去了,那么它的取值就是数组了。
{"contentStr": [{'title':'2016年雅思考试时间公布','shortTitle':'2016年雅思考试时间公布'}]}
$.getJSON(文件名, function(data){
console.log(data.contentStr[0].title);
})
添加回答
举报
0/150
提交
取消