Json对象获取ID

时间:2013-12-20 11:18:57

标签: javascript jquery json amazon

我面临一个奇怪的错误,因为我的xml文件不合适,我的json文件也不正确。因为我有这样的json输出。 enter image description here

我希望通过javascript或jquery通过ajax调用来获取它们。 我怎么能通过他们的id号得到这些对象。这是我奇怪的json文件。 举个例子:

jsRoutes.controllers.AmazonSearchController.amazonSearch(url)
                    .ajax({
                        success : function(json_results) {

                        //console.log(json_results.index[1]);                   
                    }
                });

["",{"sortBy":"salesrank","pageNumber":"1","pageSize":"10","matchCount":"10","totalCount":"34"},"","0","",{"index":"1","track":{"creator":"Rev. Melissa Smith","album":"AWS The Book - 2nd Book of Enoch","title":"2nd Book of Enoch","sellerOfRecordId":"AJ13D9WXSKXEE","merchantId":"A17SFUTIVB227Z","merchantName":"Amazon Digital Services, Inc.","image":"http://ecx.images-amazon.com/images/I/51QhN9D6xML._SS75_.jpg","duration":"3955000","trackNum":"1","{\"meta\":\"B0035H2BNE\"}":[{"rel":"http://www.amazon.com/dmusic/ASIN"}],"{\"meta\":\"DOWNLOADABLE_MUSIC_TRACK\"}":[{"rel":"http://www.amazon.com/dmusic/productTypeName"}],"{\"meta\":\"Christian & Gospel\"}":[{"rel":"http://www.amazon.com/dmusic/primaryGenre"}],"{\"meta\":\"56413428\"}":[{"rel":"http://www.amazon.com/dmusic/fileSize"}],"{\"meta\":\"0\"}":[{"rel":"http://www.amazon.com/dmusic/customerId"}],"{\"meta\":\"1\"}":[{"rel":"http://www.amazon.com/dmusic/marketplaceId"}],"{\"meta\":\"214656754\"}":[{"rel":"http://www.amazon.com/dmusic/dmid"}],"{\"meta\":\"B0035H4EUM\"}":[{"rel":"http://www.amazon.com/dmusic/albumASIN"}],"{\"meta\":\"Rev. Melissa Smith\"}":[{"rel":"http://www.amazon.com/dmusic/albumPrimaryArtist"}],"{\"meta\":\"Store\"}":[{"rel":"http://www.amazon.com/dmusic/downloadSource"}],"{\"meta\":\"http://ecx.images-amazon.com/images/I/51QhN9D6xML._SS75_.jpg\"}":[{"rel":"http://www.amazon.com/dmusic/imageThumb"}],"{\"meta\":\"20090724\"}":[{"rel":"http://www.amazon.com/dmusic/streetDate"}],"{\"meta\":\"256\"}":[{"rel":"http://www.amazon.com/dmusic/audioBitrate"}],"{\"meta\":\"http://ecx.images-amazon.com/images/I/51QhN9D6xML._SS110_.jpg\"}":[{"rel":"http://www.amazon.com/dmusic/imageTiny"}],"{\"meta\":\"B001VICDY6\"}":[{"rel":"http://www.amazon.com/dmusic/artistASIN"}],"{\"meta\":\"http://ecx.images-amazon.com/images/I/51QhN9D6xML.jpg\"}":[{"rel":"http://www.amazon.com/dmusic/imageLarge"}],"{\"meta\":\"Ancient Word Series\"}":[{"rel":"http://www.amazon.com/dmusic/label"}],"{\"meta\":\"$0.99\"}":[{"rel":"http://www.amazon.com/dmusic/price"}],"meta":{"rel":"http://www.amazon.com/dmusic/genreNodes","node":[{"name":"Christian"},{"id":"324420011"}]},"{\"meta\":\"http://ecx.images-amazon.com/images/I/51QhN9D6xML._SS160_.jpg\"}":[{"rel":"http://www.amazon.com/dmusic/imageMedium"}],"{\"meta\":\"MP3\"}":[{"rel":"http://www.amazon.com/dmusic/fileFormat"}],"{\"meta\":\"http://ecx.images-amazon.com/images/I/51QhN9D6xML._SS64_.jpg\"}":[{"rel":"http://www.amazon.com/dmusic/imageThumb64"}]}},"",{"index":"2","track":{"creator":"Jessica Seven","album":"At Odds With My Gods [Explicit]","title":"Ain't My","sellerOfRecordId":"AJ13D9WXSKXEE","merchantId":"A17SFUTIVB227Z","merchantName":"Amazon Digital Services, Inc.","image":"http://ecx.images-amazon.com/images/I/61BnLCDu5DL._SS75_.jpg","duration":"181000","trackNum":"4","{\"meta\":\"B00AVRV0F6\"}":[{"rel":"http://www.amazon.com/dmusic/ASIN"}],"{\"meta\":\"DOWNLOADABLE_MUSIC_TRACK\"}":[{"rel":"http://www.amazon.com/dmusic/productTypeName"}],"{\"meta\":\"Rock\"}":[{"rel":"http://www.amazon.com/dmusic/primaryGenre"}],"{\"meta\":\"4880138\"}":[{"rel":"http://www.amazon.com/dmusic/fileSize"}],"{\"meta\":\"0\"}":[{"rel":"http://www.amazon.com/dmusic/customerId"}],"{\"meta\":\"1\"}":[{"rel":"http://www.amazon.com/dmusic/marketplaceId"}],"{\"meta\":\"234616427\"}":[{"rel":"http://www.amazon.com/dmusic/dmid"}],"{\"meta\":\"B00AVRUZKM\"}":[{"rel":"http://www.amazon.com/dmusic/albumASIN"}],"{\"meta\":\"Jessica Seven\"}":[{"rel":"http://www.amazon.com/dmusic/albumPrimaryArtist"}],"{\"meta\":\"Store\"}":[{"rel":"http://www.amazon.com/dmusic/downloadSource"}],"{\"meta\":\"2012 Aws Entertainment\"}":[{"rel":"http://www.amazon.com/dmusic/copyright"}],"{\"meta\":\"http://ecx.images-amazon.com/images/I/61BnLCDu5DL._SS75_.jpg\"}":[{"rel":"http://www.amazon.com/dmusic/imageThumb"}],"{\"meta\":\"256\"}":[{"rel":"http://www.amazon.com/dmusic/audioBitrate"}],"{\"meta\":\"http://ecx.images-amazon.com/images/I/61BnLCDu5DL._SS110_.jpg\"}":[{"rel":"http://www.amazon.com/dmusic/imageTiny"}],"{\"meta\":\"20120611\"}":[{"rel":"http://www.amazon.com/dmusic/originalReleaseDate"}],"{\"meta\":\"B001BY4D4I\"}":[{"rel":"http://www.amazon.com/dmusic/artistASIN"}],"{\"meta\":\"http://ecx.images-amazon.com/images/I/61BnLCDu5DL.jpg\"}":[{"rel":"http://www.amazon.com/dmusic/imageLarge"}],"{\"meta\":\"Aws Entertainment\"}":[{"rel":"http://www.amazon.com/dmusic/label"}],"{\"meta\":\"$0.99\"}":[{"rel":"http://www.amazon.com/dmusic/price"}],"meta":[{"rel":"http://www.amazon.com/dmusic/deliveryRestrictions"}],"{\"meta\":\"http://ecx.images-amazon.com/images/I/61BnLCDu5DL._SS160_.jpg\"}":[{"rel":"http://www.amazon.com/dmusic/imageMedium"}],"{\"meta\":\"MP3\"}":[{"rel":"http://www.amazon.com/dmusic/fileFormat"}],"{\"meta\":\"http://ecx.images-amazon.com/images/I/61BnLCDu5DL._SS64_.jpg\"}":[{"rel":"http://www.amazon.com/dmusic/imageThumb64"}]}},"",{"index":"3","track":{"creator":"Rev. Melissa Smith","album":"AWS: The Book - Apocalypse of Abraham","title":"Apocalypse of Abraham","sellerOfRecordId":"AJ13D9WXSKXEE","merchantId":"A17SFUTIVB227Z","merchantName":"Amazon Digital Services, Inc.","image":"http://ecx.images-amazon.com/images/I/51psBoZdXjL._SS75_.jpg","duration":"3508000","trackNum":"1","{\"meta\":\"B0035HCEBS\"}":[{"rel":"http://www.amazon.com/dmusic/ASIN"}],"{\"meta\":\"DOWNLOADABLE_MUSIC_TRACK\"}":[{"rel":"http://www.amazon.com/dmusic/productTypeName"}],"{\"meta\":\"Christian & Gospel\"}":[{"rel":"http://www.amazon.com/dmusic/primaryGenre"}],"{\"meta\":\"49905095\"}":[{"rel":"http://www.amazon.com/dmusic/fileSize"}],"{\"meta\":\"0\"}":[{"rel":"http://www.amazon.com/dmusic/customerId"}],"{\"meta\":\"1\"}":[{"rel":"http://www.amazon.com/dmusic/marketplaceId"}],"{\"meta\":\"214656287\"}":[{"rel":"http://www.amazon.com/dmusic/dmid"}],"{\"meta\":\"B0035HAOJM\"}":[{"rel":"http://www.amazon.com/dmusic/albumASIN"}],"{\"meta\":\"Rev. Melissa Smith\"}":[{"rel":"http://www.amazon.com/dmusic/albumPrimaryArtist"}],"{\"meta\":\"Store\"}":[{"rel":"http://www.amazon.com/dmusic/downloadSource"}],"{\"meta\":\"http://ecx.images-amazon.com/images/I/51psBoZdXjL._SS75_.jpg\"}":[{"rel":"http://www.amazon.com/dmusic/imageThumb"}],"{\"meta\":\"20090724\"}":[{"rel":"http://www.amazon.com/dmusic/streetDate"}],"{\"meta\":\"256\"}":[{"rel":"http://www.amazon.com/dmusic/audioBitrate"}],"{\"meta\":\"http://ecx.images-amazon.com/images/I/51psBoZdXjL._SS110_.jpg\"}":[{"rel":"http://www.amazon.com/dmusic/imageTiny"}],"{\"meta\":\"B001VICDY6\"}":[{"rel":"http://www.amazon.com/dmusic/artistASIN"}],"{\"meta\":\"http://ecx.images-amazon.com/images/I/51psBoZdXjL.jpg\"}":[{"rel":"http://www.amazon.com/dmusic/imageLarge"}],"{\"meta\":\"Ancient Word Series\"}":[{"rel":"http://www.amazon.com/dmusic/label"}],"{\"meta\":\"$0.99\"}":[{"rel":"http://www.amazon.com/dmusic/price"}],"meta":{"rel":"http://www.amazon.com/dmusic/genreNodes","node":[{"name":"Christian"},{"id":"324420011"}]},"{\"meta\":\"http://ecx.images-amazon.com/images/I/51psBoZdXjL._SS160_.jpg\"}":[{"rel":"http://www.amazon.com/dmusic/imageMedium"}],"{\"meta\":\"MP3\"}":[{"rel":"http://www.amazon.com/dmusic/fileFormat"}],"{\"meta\":\"http://ecx.images-amazon.com/images/I/51psBoZdXjL._SS64_.jpg\"}":[{"rel":"http://www.amazon.com/dmusic/imageThumb64"}]}},"",{"index":"4","track":{"creator":"Jessica Seven","album":"At Odds With My Gods [Explicit]","title":"At Odds With My Gods","sellerOfRecordId":"AJ13D9WXSKXEE","merchantId":"A17SFUTIVB227Z","merchantName":"Amazon Digital Services, Inc.","image":"http://ecx.images-amazon.com/images/I/61BnLCDu5DL._SS75_.jpg","duration":"282000","trackNum":"13","{\"meta\":\"B00AVRV30S\"}":[{"rel":"http://www.amazon.com/dmusic/ASIN"}],"{\"meta\":\"DOWNLOADABLE_MUSIC_TRACK\"}":[{"rel":"http://www.amazon.com/dmusic/productTypeName"}],"{\"meta\":\"Rock\"}":[{"rel":"http://www.amazon.com/dmusic/primaryGenre"}],"{\"meta\":\"7977663\"}":[{"rel":"http://www.amazon.com/dmusic/fileSize"}],"{\"meta\":\"0\"}":[{"rel":"http://www.amazon.com/dmusic/customerId"}],"{\"meta\":\"1\"}":[{"rel":"http://www.amazon.com/dmusic/marketplaceId"}],"{\"meta\":\"234616436\"}":[{"rel":"http://www.amazon.com/dmusic/dmid"}],"{\"meta\":\"B00AVRUZKM\"}":[{"rel":"http://www.amazon.com/dmusic/albumASIN"}],"{\"meta\":\"Jessica Seven\"}":[{"rel":"http://www.amazon.com/dmusic/albumPrimaryArtist"}],"{\"meta\":\"Store\"}":[{"rel":"http://www.amazon.com/dmusic/downloadSource"}],"{\"meta\":\"2012 Aws Entertainment\"}":[{"rel":"http://www.amazon.com/dmusic/copyright"}],"{\"meta\":\"http://ecx.images-amazon.com/images/I/61BnLCDu5DL._SS75_.jpg\"}":[{"rel":"http://www.amazon.com/dmusic/imageThumb"}],"{\"meta\":\"256\"}":[{"rel":"http://www.amazon.com/dmusic/audioBitrate"}],"{\"meta\":\"http://ecx.images-amazon.com/images/I/61BnLCDu5DL._SS110_.jpg\"}":[{"rel":"http://www.amazon.com/dmusic/imageTiny"}],"{\"meta\":\"20120611\"}":[{"rel":"http://www.amazon.com/dmusic/originalReleaseDate"}],"{\"meta\":\"B001BY4D4I\"}":[{"rel":"http://www.amazon.com/dmusic/artistASIN"}],"{\"meta\":\"http://ecx.images-amazon.com/images/I/61BnLCDu5DL.jpg\"}":[{"rel":"http://www.amazon.com/dmusic/imageLarge"}],"{\"meta\":\"Aws Entertainment\"}":[{"rel":"http://www.amazon.com/dmusic/label"}],"{\"meta\":\"$0.99\"}":[{"rel":"http://www.amazon.com/dmusic/price"}],"meta":[{"rel":"http://www.amazon.com/dmusic/deliveryRestrictions"}],"{\"meta\":\"http://ecx.images-amazon.com/images/I/61BnLCDu5DL._SS160_.jpg\"}":[{"rel":"http://www.amazon.com/dmusic/imageMedium"}],"{\"meta\":\"MP3\"}":[{"rel":"http://www.amazon.com/dmusic/fileFormat"}],"{\"meta\":\"http://ecx.images-amazon.com/images/I/61BnLCDu5DL._SS64_.jpg\"}":[{"rel":"http://www.amazon.com/dmusic/imageThumb64"}]}},"",{"index":"5","track":{"creator":"Serra A.","album":"Chill Out Primavera 2008","title":"AWS","sellerOfRecordId":"AJ13D9WXSKXEE","merchantId":"A17SFUTIVB227Z","merchantName":"Amazon Digital Services, Inc.","image":"http://ecx.images-amazon.com/images/I/5131GEd4bhL._SS75_.jpg","duration":"206000","trackNum":"17","{\"meta\":\"B003GINTNS\"}":[{"rel":"http://www.amazon.com/dmusic/ASIN"}],"{\"meta\":\"DOWNLOADABLE_MUSIC_TRACK\"}":[{"rel":"http://www.amazon.com/dmusic/productTypeName"}],"{\"meta\":\"Dance & DJ\"}":[{"rel":"http://www.amazon.com/dmusic/primaryGenre"}],"{\"meta\":\"5810011\"}":[{"rel":"http://www.amazon.com/dmusic/fileSize"}],"{\"meta\":\"0\"}":[{"rel":"http://www.amazon.com/dmusic/customerId"}],"{\"meta\":\"1\"}":[{"rel":"http://www.amazon.com/dmusic/marketplaceId"}],"{\"meta\":\"215983298\"}":[{"rel":"http://www.amazon.com/dmusic/dmid"}],"{\"meta\":\"B003GIVZ1Q\"}":[{"rel":"http://www.amazon.com/dmusic/albumASIN"}],"{\"meta\":\"Various Artists\"}":[{"rel":"http://www.amazon.com/dmusic/albumPrimaryArtist"}],"{\"meta\":\"Store\"}":[{"rel":"http://www.amazon.com/dmusic/downloadSource"}],"{\"meta\":\"(c) Sound Management Corporation\"}":[{"rel":"http://www.amazon.com/dmusic/copyright"}],"{\"meta\":\"http://ecx.images-amazon.com/images/I/5131GEd4bhL._SS75_.jpg\"}":[{"rel":"http://www.amazon.com/dmusic/imageThumb"}],"{\"meta\":\"20100101\"}":[{"rel":"http://www.amazon.com/dmusic/streetDate"}],"{\"meta\":\"256\"}":[{"rel":"http://www.amazon.com/dmusic/audioBitrate"}],"{\"meta\":\"http://ecx.images-amazon.com/images/I/5131GEd4bhL._SS110_.jpg\"}":[{"rel":"http://www.amazon.com/dmusic/imageTiny"}],"{\"meta\":\"20100409\"}":[{"rel":"http://www.amazon.com/dmusic/originalReleaseDate"}],"{\"meta\":\"B003GGQ1CQ\"}":[{"rel":"http://www.amazon.com/dmusic/artistASIN"}],"{\"meta\":\"http://ecx.images-amazon.com/images/I/5131GEd4bhL.jpg\"}":[{"rel":"http://www.amazon.com/dmusic/imageLarge"}],"{\"meta\":\"Sound Management Corporation\"}":[{"rel":"http://www.amazon.com/dmusic/label"}],"{\"meta\":\"$0.89\"}":[{"rel":"http://www.amazon.com/dmusic/price"}],"meta":[{"rel":"http://www.amazon.com/dmusic/deliveryRestrictions"}],"{\"meta\":\"http://ecx.images-amazon.com/images/I/5131GEd4bhL._SS160_.jpg\"}":[{"rel":"http://www.amazon.com/dmusic/imageMedium"}],"{\"meta\":\"MP3\"}":[{"rel":"http://www.amazon.com/dmusic/fileFormat"}],"{\"meta\":\"http://ecx.images-amazon.com/images/I/5131GEd4bhL._SS64_.jpg\"}":[{"rel":"http://www.amazon.com/dmusic/imageThumb64"}]}},"",{"index":"6","track":{"creator":"Rev. Melissa Smith","album":"The Ancient Word Series Vignettes: The Gospel of Peace - The Sevenfold Peace plus More","title":"AWS: TGH12 Bonus - The Commandments","sellerOfRecordId":"AJ13D9WXSKXEE","merchantId":"A17SFUTIVB227Z","merchantName":"Amazon Digital Services, Inc.","image":"http://ecx.images-amazon.com/images/I/51zKRuAaYyL._SS75_.jpg","duration":"347000","trackNum":"3","{\"meta\":\"B001VIE70O\"}":[{"rel":"http://www.amazon.com/dmusic/ASIN"}],"{\"meta\":\"DOWNLOADABLE_MUSIC_TRACK\"}":[{"rel":"http://www.amazon.com/dmusic/productTypeName"}],"{\"meta\":\"Christian & Gospel\"}":[{"rel":"http://www.amazon.com/dmusic/primaryGenre"}],"{\"meta\":\"3655785\"}":[{"rel":"http://www.amazon.com/dmusic/fileSize"}],"{\"meta\":\"0\"}":[{"rel":"http://www.amazon.com/dmusic/customerId"}],"{\"meta\":\"1\"}":[{"rel":"http://www.amazon.com/dmusic/marketplaceId"}],"{\"meta\":\"210166823\"}":[{"rel":"http://www.amazon.com/dmusic/dmid"}],"{\"meta\":\"B001VIC3FK\"}":[{"rel":"http://www.amazon.com/dmusic/albumASIN"}],"{\"meta\":\"Rev. Melissa Smith\"}":[{"rel":"http://www.amazon.com/dmusic/albumPrimaryArtist"}],"{\"meta\":\"Store\"}":[{"rel":"http://www.amazon.com/dmusic/downloadSource"}],"{\"meta\":\"http://ecx.images-amazon.com/images/I/51zKRuAaYyL._SS75_.jpg\"}":[{"rel":"http://www.amazon.com/dmusic/imageThumb"}],"{\"meta\":\"20080907\"}":[{"rel":"http://www.amazon.com/dmusic/streetDate"}],"{\"meta\":\"256\"}":[{"rel":"http://www.amazon.com/dmusic/audioBitrate"}],"{\"meta\":\"http://ecx.images-amazon.com/images/I/51zKRuAaYyL._SS110_.jpg\"}":[{"rel":"http://www.amazon.com/dmusic/imageTiny"}],"{\"meta\":\"B001VICDY6\"}":[{"rel":"http://www.amazon.com/dmusic/artistASIN"}],"{\"meta\":\"http://ecx.images-amazon.com/images/I/51zKRuAaYyL.jpg\"}":[{"rel":"http://www.amazon.com/dmusic/imageLarge"}],"{\"meta\":\"Ancient Word Series\"}":[{"rel":"http://www.amazon.com/dmusic/label"}],"{\"meta\":\"$0.99\"}":[{"rel":"http://www.amazon.com/dmusic/price"}],"meta":{"rel":"http://www.amazon.com/dmusic/genreNodes","node":[[{"name":"Miscellaneous/Poetry, Spoken Word & Interviews"},{"id":"324582011"}],[{"name":"Miscellaneous"},{"id":"324577011"}],[{"name":"Christian"},{"id":"324420011"}]]},"{\"meta\":\"http://ecx.images-amazon.com/images/I/51zKRuAaYyL._SS160_.jpg\"}":[{"rel":"http://www.amazon.com/dmusic/imageMedium"}],"{\"meta\":\"MP3\"}":[{"rel":"http://www.amazon.com/dmusic/fileFormat"}],"{\"meta\":\"http://ecx.images-amazon.com/images/I/51zKRuAaYyL._SS64_.jpg\"}":[{"rel":"http://www.amazon.com/dmusic/imageThumb64"}]}},"",{"index":"7","track":{"creator":"Jessica Seven","album":"At Odds With My Gods [Explicit]","title":"The Beautiful People [Explicit]","sellerOfRecordId":"AJ13D9WXSKXEE","merchantId":"A17SFUTIVB227Z","merchantName":"Amazon Digital Services, Inc.","image":"http://ecx.images-amazon.com/images/I/61BnLCDu5DL._SS75_.jpg","duration":"216000","trackNum":"15","{\"meta\":\"B00AVRV3H6\"}":[{"rel":"http://www.amazon.com/dmusic/ASIN"}],"{\"meta\":\"DOWNLOADABLE_MUSIC_TRACK\"}":[{"rel":"http://www.amazon.com/dmusic/productTypeName"}],"{\"meta\":\"Rock\"}":[{"rel":"http://www.amazon.com/dmusic/primaryGenre"}],"{\"meta\":\"5413224\"}":[{"rel":"http://www.amazon.com/dmusic/fileSize"}],"{\"meta\":\"0\"}":[{"rel":"http://www.amazon.com/dmusic/customerId"}],"{\"meta\":\"1\"}":[{"rel":"http://www.amazon.com/dmusic/marketplaceId"}],"{\"meta\":\"234616438\"}":[{"rel":"http://www.amazon.com/dmusic/dmid"}],"{\"meta\":\"B00AVRUZKM\"}":[{"rel":"http://www.amazon.com/dmusic/albumASIN"}],"{\"meta\":\"Jessica Seven\"}":[{"rel":"http://www.amazon.com/dmusic/albumPrimaryArtist"}],"{\"meta\":\"Store\"}":[{"rel":"http://www.amazon.com/dmusic/downloadSource"}],"{\"meta\":\"2012 Aws Entertainment\"}":[{"rel":"http://www.amazon.com/dmusic/copyright"}],"{\"meta\":\"http://ecx.images-amazon.com/images/I/61BnLCDu5DL._SS75_.jpg\"}":[{"rel":"http://www.amazon.com/dmusic/imageThumb"}],"{\"meta\":\"256\"}":[{"rel":"http://www.amazon.com/dmusic/audioBitrate"}],"{\"meta\":\"http://ecx.images-amazon.com/images/I/61BnLCDu5DL._SS110_.jpg\"}":[{"rel":"http://www.amazon.com/dmusic/imageTiny"}],"{\"meta\":\"20120611\"}":[{"rel":"http://www.amazon.com/dmusic/originalReleaseDate"}],"{\"meta\":\"B001BY4D4I\"}":[{"rel":"http://www.amazon.com/dmusic/artistASIN"}],"{\"meta\":\"http://ecx.images-amazon.com/images/I/61BnLCDu5DL.jpg\"}":[{"rel":"http://www.amazon.com/dmusic/imageLarge"}],"{\"meta\":\"Aws Entertainment\"}":[{"rel":"http://www.amazon.com/dmusic/label"}],"{\"meta\":\"$0.99\"}":[{"rel":"http://www.amazon.com/dmusic/price"}],"meta":[{"rel":"http://www.amazon.com/dmusic/deliveryRestrictions"}],"{\"meta\":\"http://ecx.images-amazon.com/images/I/61BnLCDu5DL._SS160_.jpg\"}":[{"rel":"http://www.amazon.com/dmusic/imageMedium"}],"{\"meta\":\"MP3\"}":[{"rel":"http://www.amazon.com/dmusic/fileFormat"}],"{\"meta\":\"http://ecx.images-amazon.com/images/I/61BnLCDu5DL._SS64_.jpg\"}":[{"rel":"http://www.amazon.com/dmusic/imageThumb64"}]}},"",{"index":"8","track":{"creator":"Aws","album":"Fata Morgana","title":"Buried attitude","sellerOfRecordId":"AJ13D9WXSKXEE","merchantId":"A17SFUTIVB227Z","merchantName":"Amazon Digital Services, Inc.","image":"http://ecx.images-amazon.com/images/I/61duv55IB7L._SS75_.jpg","duration":"278000","trackNum":"5","{\"meta\":\"B006YW5FFI\"}":[{"rel":"http://www.amazon.com/dmusic/ASIN"}],"{\"meta\":\"DOWNLOADABLE_MUSIC_TRACK\"}":[{"rel":"http://www.amazon.com/dmusic/productTypeName"}],"{\"meta\":\"Hard Rock & Metal\"}":[{"rel":"http://www.amazon.com/dmusic/primaryGenre"}],"{\"meta\":\"10494280\"}":[{"rel":"http://www.amazon.com/dmusic/fileSize"}],"{\"meta\":\"0\"}":[{"rel":"http://www.amazon.com/dmusic/customerId"}],"{\"meta\":\"1\"}":[{"rel":"http://www.amazon.com/dmusic/marketplaceId"}],"{\"meta\":\"227260895\"}":[{"rel":"http://www.amazon.com/dmusic/dmid"}],"{\"meta\":\"B006YW5ESG\"}":[{"rel":"http://www.amazon.com/dmusic/albumASIN"}],"{\"meta\":\"Aws\"}":[{"rel":"http://www.amazon.com/dmusic/albumPrimaryArtist"}],"{\"meta\":\"Store\"}":[{"rel":"http://www.amazon.com/dmusic/downloadSource"}],"{\"meta\":\"http://ecx.images-amazon.com/images/I/61duv55IB7L._SS75_.jpg\"}":[{"rel":"http://www.amazon.com/dmusic/imageThumb"}],"{\"meta\":\"256\"}":[{"rel":"http://www.amazon.com/dmusic/audioBitrate"}],"{\"meta\":\"http://ecx.images-amazon.com/images/I/61duv55IB7L._SS110_.jpg\"}":[{"rel":"http://www.amazon.com/dmusic/imageTiny"}],"{\"meta\":\"20110425\"}":[{"rel":"http://www.amazon.com/dmusic/originalReleaseDate"}],"{\"meta\":\"B0027RUIBU\"}":[{"rel":"http://www.amazon.com/dmusic/artistASIN"}],"{\"meta\":\"http://ecx.images-amazon.com/images/I/61duv55IB7L.jpg\"}":[{"rel":"http://www.amazon.com/dmusic/imageLarge"}],"{\"meta\":\"EDGE Records (HMR Music Kft.)\"}":[{"rel":"http://www.amazon.com/dmusic/label"}],"{\"meta\":\"$0.99\"}":[{"rel":"http://www.amazon.com/dmusic/price"}],"meta":[{"rel":"http://www.amazon.com/dmusic/deliveryRestrictions"}],"{\"meta\":\"http://ecx.images-amazon.com/images/I/61duv55IB7L._SS160_.jpg\"}":[{"rel":"http://www.amazon.com/dmusic/imageMedium"}],"{\"meta\":\"MP3\"}":[{"rel":"http://www.amazon.com/dmusic/fileFormat"}],"{\"meta\":\"http://ecx.images-amazon.com/images/I/61duv55IB7L._SS64_.jpg\"}":[{"rel":"http://www.amazon.com/dmusic/imageThumb64"}]}},"",{"index":"9","track":{"creator":"Jessica Seven","album":"At Odds With My Gods [Explicit]","title":"Cacophonic Concerto","sellerOfRecordId":"AJ13D9WXSKXEE","merchantId":"A17SFUTIVB227Z","merchantName":"Amazon Digital Services, Inc.","image":"http://ecx.images-amazon.com/images/I/61BnLCDu5DL._SS75_.jpg","duration":"87000","trackNum":"6","{\"meta\":\"B00AVRV1OG\"}":[{"rel":"http://www.amazon.com/dmusic/ASIN"}],"{\"meta\":\"DOWNLOADABLE_MUSIC_TRACK\"}":[{"rel":"http://www.amazon.com/dmusic/productTypeName"}],"{\"meta\":\"Rock\"}":[{"rel":"http://www.amazon.com/dmusic/primaryGenre"}],"{\"meta\":\"2657664\"}":[{"rel":"http://www.amazon.com/dmusic/fileSize"}],"{\"meta\":\"0\"}":[{"rel":"http://www.amazon.com/dmusic/customerId"}],"{\"meta\":\"1\"}":[{"rel":"http://www.amazon.com/dmusic/marketplaceId"}],"{\"meta\":\"234616429\"}":[{"rel":"http://www.amazon.com/dmusic/dmid"}],"{\"meta\":\"B00AVRUZKM\"}":[{"rel":"http://www.amazon.com/dmusic/albumASIN"}],"{\"meta\":\"Jessica Seven\"}":[{"rel":"http://www.amazon.com/dmusic/albumPrimaryArtist"}],"{\"meta\":\"Store\"}":[{"rel":"http://www.amazon.com/dmusic/downloadSource"}],"{\"meta\":\"2012 Aws Entertainment\"}":[{"rel":"http://www.amazon.com/dmusic/copyright"}],"{\"meta\":\"http://ecx.images-amazon.com/images/I/61BnLCDu5DL._SS75_.jpg\"}":[{"rel":"http://www.amazon.com/dmusic/imageThumb"}],"{\"meta\":\"256\"}":[{"rel":"http://www.amazon.com/dmusic/audioBitrate"}],"{\"meta\":\"http://ecx.images-amazon.com/images/I/61BnLCDu5DL._SS110_.jpg\"}":[{"rel":"http://www.amazon.com/dmusic/imageTiny"}],"{\"meta\":\"20120611\"}":[{"rel":"http://www.amazon.com/dmusic/originalReleaseDate"}],"{\"meta\":\"B001BY4D4I\"}":[{"rel":"http://www.amazon.com/dmusic/artistASIN"}],"{\"meta\":\"http://ecx.images-amazon.com/images/I/61BnLCDu5DL.jpg\"}":[{"rel":"http://www.amazon.com/dmusic/imageLarge"}],"{\"meta\":\"Aws Entertainment\"}":[{"rel":"http://www.amazon.com/dmusic/label"}],"{\"meta\":\"$0.99\"}":[{"rel":"http://www.amazon.com/dmusic/price"}],"meta":[{"rel":"http://www.amazon.com/dmusic/deliveryRestrictions"}],"{\"meta\":\"http://ecx.images-amazon.com/images/I/61BnLCDu5DL._SS160_.jpg\"}":[{"rel":"http://www.amazon.com/dmusic/imageMedium"}],"{\"meta\":\"MP3\"}":[{"rel":"http://www.amazon.com/dmusic/fileFormat"}],"{\"meta\":\"http://ecx.images-amazon.com/images/I/61BnLCDu5DL._SS64_.jpg\"}":[{"rel":"http://www.amazon.com/dmusic/imageThumb64"}]}},"",{"index":"10","track":{"creator":"Jessica Seven","album":"At Odds With My Gods [Explicit]","title":"Damaged Goods","sellerOfRecordId":"AJ13D9WXSKXEE","merchantId":"A17SFUTIVB227Z","merchantName":"Amazon Digital Services, Inc.","image":"http://ecx.images-amazon.com/images/I/61BnLCDu5DL._SS75_.jpg","duration":"216000","trackNum":"8","{\"meta\":\"B00AVRV20O\"}":[{"rel":"http://www.amazon.com/dmusic/ASIN"}],"{\"meta\":\"DOWNLOADABLE_MUSIC_TRACK\"}":[{"rel":"http://www.amazon.com/dmusic/productTypeName"}],"{\"meta\":\"Rock\"}":[{"rel":"http://www.amazon.com/dmusic/primaryGenre"}],"{\"meta\":\"5605119\"}":[{"rel":"http://www.amazon.com/dmusic/fileSize"}],"{\"meta\":\"0\"}":[{"rel":"http://www.amazon.com/dmusic/customerId"}],"{\"meta\":\"1\"}":[{"rel":"http://www.amazon.com/dmusic/marketplaceId"}],"{\"meta\":\"234616431\"}":[{"rel":"http://www.amazon.com/dmusic/dmid"}],"{\"meta\":\"B00AVRUZKM\"}":[{"rel":"http://www.amazon.com/dmusic/albumASIN"}],"{\"meta\":\"Jessica Seven\"}":[{"rel":"http://www.amazon.com/dmusic/albumPrimaryArtist"}],"{\"meta\":\"Store\"}":[{"rel":"http://www.amazon.com/dmusic/downloadSource"}],"{\"meta\":\"2012 Aws Entertainment\"}":[{"rel":"http://www.amazon.com/dmusic/copyright"}],"{\"meta\":\"http://ecx.images-amazon.com/images/I/61BnLCDu5DL._SS75_.jpg\"}":[{"rel":"http://www.amazon.com/dmusic/imageThumb"}],"{\"meta\":\"256\"}":[{"rel":"http://www.amazon.com/dmusic/audioBitrate"}],"{\"meta\":\"http://ecx.images-amazon.com/images/I/61BnLCDu5DL._SS110_.jpg\"}":[{"rel":"http://www.amazon.com/dmusic/imageTiny"}],"{\"meta\":\"20120611\"}":[{"rel":"http://www.amazon.com/dmusic/originalReleaseDate"}],"{\"meta\":\"B001BY4D4I\"}":[{"rel":"http://www.amazon.com/dmusic/artistASIN"}],"{\"meta\":\"http://ecx.images-amazon.com/images/I/61BnLCDu5DL.jpg\"}":[{"rel":"http://www.amazon.com/dmusic/imageLarge"}],"{\"meta\":\"Aws Entertainment\"}":[{"rel":"http://www.amazon.com/dmusic/label"}],"{\"meta\":\"$0.99\"}":[{"rel":"http://www.amazon.com/dmusic/price"}],"meta":[{"rel":"http://www.amazon.com/dmusic/deliveryRestrictions"}],"{\"meta\":\"http://ecx.images-amazon.com/images/I/61BnLCDu5DL._SS160_.jpg\"}":[{"rel":"http://www.amazon.com/dmusic/imageMedium"}],"{\"meta\":\"MP3\"}":[{"rel":"http://www.amazon.com/dmusic/fileFormat"}],"{\"meta\":\"http://ecx.images-amazon.com/images/I/61BnLCDu5DL._SS64_.jpg\"}":[{"rel":"http://www.amazon.com/dmusic/imageThumb64"}]}},""]

1 个答案:

答案 0 :(得分:1)

试试这个(http://jsfiddle.net/quMd4/1/

     var obj = [yourJSON];
     function getObjects(obj, key, val) {
        var objects = [];
        for (var i in obj) {
            if (!obj.hasOwnProperty(i)) continue;
            if (typeof obj[i] == 'object') {
                objects = objects.concat(getObjects(obj[i], key, val));
            } else if (i == key && obj[key] == val) {
                objects.push(obj);
            }
        }
        return objects;
    }

    var res = getObjects(obj, 'index', '5');