我在解析jQuery中的json数组时遇到了问题。json在jQuery中的解析问题
我的JSON数组是
({resultCount:1, results:[{wrapperType:"track", kind:"song", artistId:255303209, collectionId:536282724, trackId:536282832, artistName:"Flo Rida", collectionName:"Wild Ones (Deluxe Version)", trackName:"I Cry", collectionCensoredName:"Wild Ones (Deluxe Version)", trackCensoredName:"I Cry", artistViewUrl:"https://itunes.apple.com/us/artist/flo-rida/id255303209?uo=4", collectionViewUrl:"https://itunes.apple.com/us/album/i-cry/id536282724?i=536282832&uo=4", trackViewUrl:"https://itunes.apple.com/us/album/i-cry/id536282724?i=536282832&uo=4", previewUrl:"http://a1278.phobos.apple.com/us/r1000/073/Music/09/3d/27/mzm.wwzzwbfq.aac.p.m4a", artworkUrl30:"http://a1395.phobos.apple.com/us/r1000/112/Music/v4/25/03/bb/2503bb1c-fbf4-4f5d-b249-9a2c3cfe24d6/075679960399.30x30-50.jpg", artworkUrl60:"http://a1459.phobos.apple.com/us/r1000/112/Music/v4/25/03/bb/2503bb1c-fbf4-4f5d-b249-9a2c3cfe24d6/075679960399.60x60-50.jpg", artworkUrl100:"http://a1796.phobos.apple.com/us/r1000/112/Music/v4/25/03/bb/2503bb1c-fbf4-4f5d-b249-9a2c3cfe24d6/075679960399.100x100-75.jpg", collectionPrice:7.99, trackPrice:1.29, releaseDate:"2012-06-22T07:00:00Z", collectionExplicitness:"notExplicit", trackExplicitness:"notExplicit", discCount:1, discNumber:1, trackCount:10, trackNumber:8, trackTimeMillis:223800, country:"USA", currency:"USD", primaryGenreName:"Hip Hop/Rap"}]})
在这阵我得artworkUrl30,TRACKNAME。 如何做到这一点? 当我尝试解析这个我得到这个错误 语法错误:JSON.parse:预计双引号的属性名
编辑 我打电话这是iTunes的回调像
function GetDetailsFromitunes(data){
var mvar = jQuery.parseJSON(data);
console.log(mvar.resultCount);
}
我根据我的工作本文件提前
谢谢。
你能告诉我们你用来检索这个代码以及你如何试图解析它吗? –
@ExplosionPills回复它的一个itune回调函数的任何帮助? –
你什么时候调用'GetDetailsFromitunes'? –