我正在尝试迭代从Flickr api返回的JSON对象,似乎无法解决它。
我拥有的JSON对象是:
{"photos":{"page":1, "pages":99550, "perpage":100, "total":"9954982", "photo":[{"id":"6958775623", "owner":"78112161@N00", "secret":"53cd417df3", "server":"7184", "farm":8, "title":"LondonMar2010_0355", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7184\/6958775623_53cd417df3_m.jpg", "height_s":"180", "width_s":"240"}, {"id":"6958746885", "owner":"40850111@N04", "secret":"bf2189f026", "server":"7209", "farm":8, "title":"Arundel Street, March 2012", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7209\/6958746885_bf2189f026_m.jpg", "height_s":"240", "width_s":"240"}, {"id":"6812586580", "owner":"39731978@N04", "secret":"07eb078b6b", "server":"7189", "farm":8, "title":"Stratford Station, Olympic Gateway", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7189\/6812586580_07eb078b6b_m.jpg", "height_s":"240", "width_s":"240"}, {"id":"6812571906", "owner":"55661684@N00", "secret":"8f368d9dcf", "server":"7192", "farm":8, "title":"SoHo London", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7192\/6812571906_8f368d9dcf_m.jpg", "height_s":"240", "width_s":"159"}, {"id":"6812550486", "owner":"41219989@N08", "secret":"0c214d0a46", "server":"7187", "farm":8, "title":"IMG_3466", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7187\/6812550486_0c214d0a46_m.jpg", "height_s":"240", "width_s":"171"}, {"id":"6958458849", "owner":"66133288@N06", "secret":"db3c576209", "server":"7197", "farm":8, "title":"St Paul's Cathedral on the Edge - Manual HDR", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7197\/6958458849_db3c576209_m.jpg", "height_s":"240", "width_s":"160"}, {"id":"6958754605", "owner":"42892586@N02", "secret":"5560dc871c", "server":"7060", "farm":8, "title":"Walking in shadows", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7060\/6958754605_5560dc871c_m.jpg", "height_s":"170", "width_s":"240"}, {"id":"6812589980", "owner":"58406131@N05", "secret":"0703b7a26f", "server":"7185", "farm":8, "title":"Scarlet Sky", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7185\/6812589980_0703b7a26f_m.jpg", "height_s":"128", "width_s":"240"}, {"id":"6958689757", "owner":"8999207@N04", "secret":"6fc4bdda4b", "server":"7202", "farm":8, "title":"Pablo II", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7202\/6958689757_6fc4bdda4b_m.jpg", "height_s":"162", "width_s":"240"}, {"id":"6958686689", "owner":"8999207@N04", "secret":"3d1510c4d1", "server":"7042", "farm":8, "title":"Riverside", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7042\/6958686689_3d1510c4d1_m.jpg", "height_s":"162", "width_s":"240"}, {"id":"6958760089", "owner":"59929210@N08", "secret":"f26d01c57f", "server":"7194", "farm":8, "title":"the imperial professor piggy, london", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7194\/6958760089_f26d01c57f_m.jpg", "height_s":"180", "width_s":"240"}, {"id":"6958682887", "owner":"55661684@N00", "secret":"a111537a9d", "server":"7053", "farm":8, "title":"SoHo London", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7053\/6958682887_a111537a9d_m.jpg", "height_s":"240", "width_s":"160"}, {"id":"6812580192", "owner":"8999207@N04", "secret":"577e13ba09", "server":"7183", "farm":8, "title":"Pablo I", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7183\/6812580192_577e13ba09_m.jpg", "height_s":"162", "width_s":"240"}, {"id":"6812552500", "owner":"43102195@N08", "secret":"9ef2080674", "server":"7044", "farm":8, "title":"Arguably the only goods people need these days are food and happiness --- Sir Terence Conran", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7044\/6812552500_9ef2080674_m.jpg", "height_s":"160", "width_s":"240"}, {"id":"6958732217", "owner":"22119200@N08", "secret":"9475d27c63", "server":"7069", "farm":8, "title":"Going Underground", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7069\/6958732217_9475d27c63_m.jpg", "height_s":"180", "width_s":"240"}, {"id":"6812571414", "owner":"55661684@N00", "secret":"37f8910190", "server":"7184", "farm":8, "title":"SoHo London", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7184\/6812571414_37f8910190_m.jpg", "height_s":"240", "width_s":"160"}, {"id":"6958439641", "owner":"76512404@N00", "secret":"874ed04d14", "server":"7192", "farm":8, "title":"A Tale of Two Cities", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7192\/6958439641_874ed04d14_m.jpg", "height_s":"160", "width_s":"240"}, {"id":"6958667137", "owner":"57228413@N02", "secret":"c871e0e43a", "server":"7056", "farm":8, "title":"holland-park-55.jpg", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7056\/6958667137_c871e0e43a_m.jpg", "height_s":"240", "width_s":"160"}, {"id":"6812526366", "owner":"43102195@N08", "secret":"c63ce5ba17", "server":"7207", "farm":8, "title":"Perhaps believing in good design is like believing in God, it makes you an optimist. --- Sir Terence Conran", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7207\/6812526366_c63ce5ba17_m.jpg", "height_s":"160", "width_s":"240"}, {"id":"6812631686", "owner":"40850111@N04", "secret":"2e55fbba38", "server":"7187", "farm":8, "title":"Circle Line, March 2012", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7187\/6812631686_2e55fbba38_m.jpg", "height_s":"240", "width_s":"240"}, {"id":"6958683459", "owner":"55661684@N00", "secret":"9451846571", "server":"7051", "farm":8, "title":"SoHo London", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7051\/6958683459_9451846571_m.jpg", "height_s":"240", "width_s":"160"}, {"id":"6958681083", "owner":"55661684@N00", "secret":"eb0726ef72", "server":"7054", "farm":8, "title":"SoHo London", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7054\/6958681083_eb0726ef72_m.jpg", "height_s":"240", "width_s":"160"}, {"id":"6812570204", "owner":"55661684@N00", "secret":"60ee2a7583", "server":"7185", "farm":8, "title":"SoHo London", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7185\/6812570204_60ee2a7583_m.jpg", "height_s":"240", "width_s":"160"}, {"id":"6958660339", "owner":"41219989@N08", "secret":"cbe3b391e7", "server":"7038", "farm":8, "title":"IMG_3474", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7038\/6958660339_cbe3b391e7_m.jpg", "height_s":"160", "width_s":"240"}, {"id":"6958661529", "owner":"41219989@N08", "secret":"d7edf899dd", "server":"7208", "farm":8, "title":"IMG_3548", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7208\/6958661529_d7edf899dd_m.jpg", "height_s":"160", "width_s":"240"}, {"id":"6812529088", "owner":"23678287@N06", "secret":"9cdc63ff9d", "server":"7056", "farm":8, "title":"Crystal Palace Reflections", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7056\/6812529088_9cdc63ff9d_m.jpg", "height_s":"240", "width_s":"240"}, {"id":"6958410549", "owner":"56539745@N00", "secret":"3612f90fa6", "server":"7194", "farm":8, "title":"More Levitation outside Parliament", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7194\/6958410549_3612f90fa6_m.jpg", "height_s":"159", "width_s":"240"}, {"id":"6812551778", "owner":"41219989@N08", "secret":"1270bd25c5", "server":"7036", "farm":8, "title":"IMG_3469", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7036\/6812551778_1270bd25c5_m.jpg", "height_s":"163", "width_s":"240"}, {"id":"6958664183", "owner":"41219989@N08", "secret":"683aa11581", "server":"7205", "farm":8, "title":"IMG_3479", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7205\/6958664183_683aa11581_m.jpg", "height_s":"169", "width_s":"240"}, {"id":"6807108666", "owner":"60021796@N03", "secret":"7c8023be81", "server":"7179", "farm":8, "title":"Shrouded in Mist.", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7179\/6807108666_7c8023be81_m.jpg", "height_s":"160", "width_s":"240"}, {"id":"6812613042", "owner":"22119200@N08", "secret":"5ec135c3a1", "server":"7057", "farm":8, "title":"Going Underground", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7057\/6812613042_5ec135c3a1_m.jpg", "height_s":"180", "width_s":"240"}, {"id":"6958681323", "owner":"57228413@N02", "secret":"b39be78065", "server":"7198", "farm":8, "title":"holland-park-75.jpg", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7198\/6958681323_b39be78065_m.jpg", "height_s":"240", "width_s":"160"}, {"id":"6812573246", "owner":"8999207@N04", "secret":"3cb31d8dca", "server":"7183", "farm":8, "title":"Valen en Cassiobury", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7183\/6812573246_3cb31d8dca_m.jpg", "height_s":"162", "width_s":"240"}, {"id":"6958652179", "owner":"23168109@N08", "secret":"c52809cee0", "server":"7062", "farm":8, "title":"madonna of the wall", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7062\/6958652179_c52809cee0_m.jpg", "height_s":"240", "width_s":"161"}, {"id":"6812535654", "owner":"57228413@N02", "secret":"3b1e63144a", "server":"7198", "farm":8, "title":"holland-park-16.jpg", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7198\/6812535654_3b1e63144a_m.jpg", "height_s":"160", "width_s":"240"}, {"id":"6958721845", "owner":"22119200@N08", "secret":"da83edb7c6", "server":"7204", "farm":8, "title":"Going Underground", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7204\/6958721845_da83edb7c6_m.jpg", "height_s":"180", "width_s":"240"}, {"id":"6812529040", "owner":"23678287@N06", "secret":"fa1c6c1a23", "server":"7200", "farm":8, "title":"Big red doors", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7200\/6812529040_fa1c6c1a23_m.jpg", "height_s":"240", "width_s":"240"}, {"id":"6956903097", "owner":"61124162@N08", "secret":"27154225c9", "server":"7186", "farm":8, "title":"", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7186\/6956903097_27154225c9_m.jpg", "height_s":"159", "width_s":"240"}, {"id":"6812574806", "owner":"57228413@N02", "secret":"0b3ac3421d", "server":"7208", "farm":8, "title":"holland-park-81.jpg", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7208\/6812574806_0b3ac3421d_m.jpg", "height_s":"240", "width_s":"160"}, {"id":"6812572646", "owner":"55661684@N00", "secret":"56ae32a70f", "server":"7208", "farm":8, "title":"SoHo London", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7208\/6812572646_56ae32a70f_m.jpg", "height_s":"240", "width_s":"160"}, {"id":"6812563810", "owner":"42439997@N04", "secret":"cbaa2bc30d", "server":"7039", "farm":8, "title":"Performante.", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7039\/6812563810_cbaa2bc30d_m.jpg", "height_s":"161", "width_s":"240"}, {"id":"6812543428", "owner":"23168109@N08", "secret":"19106c31fc", "server":"7069", "farm":8, "title":"woof", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7069\/6812543428_19106c31fc_m.jpg", "height_s":"161", "width_s":"240"}, {"id":"6812552690", "owner":"41219989@N08", "secret":"2a752e99a3", "server":"7184", "farm":8, "title":"IMG_3537", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7184\/6812552690_2a752e99a3_m.jpg", "height_s":"142", "width_s":"240"}, {"id":"6812543270", "owner":"23168109@N08", "secret":"459d2de824", "server":"7066", "farm":8, "title":"all because she loves...", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7066\/6812543270_459d2de824_m.jpg", "height_s":"240", "width_s":"161"}, {"id":"6958721669", "owner":"7265074@N08", "secret":"804bc5af0b", "server":"7206", "farm":8, "title":"I Know Places", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7206\/6958721669_804bc5af0b_m.jpg", "height_s":"240", "width_s":"240"}, {"id":"6958720951", "owner":"90174933@N00", "secret":"879543bc10", "server":"7178", "farm":8, "title":"March newsletter", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7178\/6958720951_879543bc10_m.jpg", "height_s":"240", "width_s":"107"}, {"id":"6812574000", "owner":"55661684@N00", "secret":"4ebbeb6f3d", "server":"7048", "farm":8, "title":"SoHo London", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7048\/6812574000_4ebbeb6f3d_m.jpg", "height_s":"160", "width_s":"240"}, {"id":"6812574440", "owner":"55661684@N00", "secret":"889eaf8170", "server":"7193", "farm":8, "title":"SoHo London", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7193\/6812574440_889eaf8170_m.jpg", "height_s":"240", "width_s":"160"}, {"id":"6812560578", "owner":"43102195@N08", "secret":"b7af7359eb", "server":"7207", "farm":8, "title":"Arguably the only goods people need these days are food and happiness --- Sir Terence Conran", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7207\/6812560578_b7af7359eb_m.jpg", "height_s":"240", "width_s":"240"}, {"id":"6958663307", "owner":"41219989@N08", "secret":"3b4c9e4f08", "server":"7061", "farm":8, "title":"IMG_3480", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7061\/6958663307_3b4c9e4f08_m.jpg", "height_s":"142", "width_s":"240"}, {"id":"6812547774", "owner":"57228413@N02", "secret":"7ae451f2b5", "server":"7065", "farm":8, "title":"holland-park-19.jpg", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7065\/6812547774_7ae451f2b5_m.jpg", "height_s":"240", "width_s":"160"}, {"id":"6812544944", "owner":"46659385@N00", "secret":"2189b71956", "server":"7048", "farm":8, "title":"All yellow", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7048\/6812544944_2189b71956_m.jpg", "height_s":"135", "width_s":"240"}, {"id":"6812612940", "owner":"7974331@N02", "secret":"a1997ae08d", "server":"7184", "farm":8, "title":"", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7184\/6812612940_a1997ae08d_m.jpg", "height_s":"161", "width_s":"240"}, {"id":"6812575076", "owner":"37117895@N02", "secret":"107821bd89", "server":"7187", "farm":8, "title":"In disguise (73\/365)", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7187\/6812575076_107821bd89_m.jpg", "height_s":"240", "width_s":"160"}, {"id":"6958683091", "owner":"55661684@N00", "secret":"369ab9db1d", "server":"7182", "farm":8, "title":"SoHo London", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7182\/6958683091_369ab9db1d_m.jpg", "height_s":"240", "width_s":"160"}, {"id":"6958665119", "owner":"74264857@N00", "secret":"4e9dd04252", "server":"7051", "farm":8, "title":"Red on Red", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7051\/6958665119_4e9dd04252_m.jpg", "height_s":"240", "width_s":"180"}, {"id":"6812542928", "owner":"43102195@N08", "secret":"348c333325", "server":"7184", "farm":8, "title":"Arguably the only goods people need these days are food and happiness --- Sir Terence Conran", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7184\/6812542928_348c333325_m.jpg", "height_s":"160", "width_s":"240"}, {"id":"6958639567", "owner":"38916598@N08", "secret":"b665ff94f5", "server":"7181", "farm":8, "title":"untitled-9036.jpg", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7181\/6958639567_b665ff94f5_m.jpg", "height_s":"160", "width_s":"240"}, {"id":"6812528180", "owner":"38916598@N08", "secret":"a7623730fe", "server":"7063", "farm":8, "title":"untitled-8874.jpg", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7063\/6812528180_a7623730fe_m.jpg", "height_s":"160", "width_s":"240"}, {"id":"6958641767", "owner":"57228413@N02", "secret":"ccd1631350", "server":"7182", "farm":8, "title":"holland-park-14.jpg", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7182\/6958641767_ccd1631350_m.jpg", "height_s":"160", "width_s":"240"}, {"id":"6812600524", "owner":"75686528@N03", "secret":"3156e2c212", "server":"7187", "farm":8, "title":"Press coverage from day 3", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7187\/6812600524_3156e2c212_m.jpg", "height_s":"180", "width_s":"240"}, {"id":"6958682457", "owner":"8999207@N04", "secret":"629b1b81a2", "server":"7176", "farm":8, "title":"Good Boy!", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7176\/6958682457_629b1b81a2_m.jpg", "height_s":"162", "width_s":"240"}, {"id":"6812554472", "owner":"41219989@N08", "secret":"357d728827", "server":"7199", "farm":8, "title":"IMG_3547", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7199\/6812554472_357d728827_m.jpg", "height_s":"240", "width_s":"170"}, {"id":"6812539966", "owner":"7974331@N02", "secret":"2b0b4734fd", "server":"7038", "farm":8, "title":"", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7038\/6812539966_2b0b4734fd_m.jpg", "height_s":"161", "width_s":"240"}, {"id":"6958641497", "owner":"64604741@N07", "secret":"28989c6300", "server":"7206", "farm":8, "title":"366 Project - #64", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7206\/6958641497_28989c6300_m.jpg", "height_s":"240", "width_s":"240"}, {"id":"6958680327", "owner":"37117895@N02", "secret":"3d3d6d8cc3", "server":"7045", "farm":8, "title":"Look West (72\/365)", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7045\/6958680327_3d3d6d8cc3_m.jpg", "height_s":"160", "width_s":"240"}, {"id":"6958682665", "owner":"55661684@N00", "secret":"86a701ee45", "server":"7208", "farm":8, "title":"SoHo London", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7208\/6958682665_86a701ee45_m.jpg", "height_s":"160", "width_s":"240"}, {"id":"6958668091", "owner":"43076356@N03", "secret":"c26f8c0e42", "server":"7176", "farm":8, "title":"View of London", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7176\/6958668091_c26f8c0e42_m.jpg", "height_s":"180", "width_s":"240"}, {"id":"6958667743", "owner":"43076356@N03", "secret":"04655ed934", "server":"7050", "farm":8, "title":"View of London", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7050\/6958667743_04655ed934_m.jpg", "height_s":"180", "width_s":"240"}, {"id":"6812526276", "owner":"38916598@N08", "secret":"260166d035", "server":"7040", "farm":8, "title":"untitled-8866.jpg", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7040\/6812526276_260166d035_m.jpg", "height_s":"240", "width_s":"160"}, {"id":"6958680893", "owner":"55661684@N00", "secret":"e46e71a315", "server":"7062", "farm":8, "title":"SoHo London", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7062\/6958680893_e46e71a315_m.jpg", "height_s":"240", "width_s":"160"}, {"id":"6812571186", "owner":"55661684@N00", "secret":"f139a3a63c", "server":"7037", "farm":8, "title":"SoHo London", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7037\/6812571186_f139a3a63c_m.jpg", "height_s":"160", "width_s":"240"}, {"id":"6958679063", "owner":"55661684@N00", "secret":"d3c162bd7c", "server":"7065", "farm":8, "title":"SoHo London", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7065\/6958679063_d3c162bd7c_m.jpg", "height_s":"160", "width_s":"240"}, {"id":"6958626585", "owner":"40506150@N00", "secret":"ffbbb2d8f6", "server":"7203", "farm":8, "title":"London Fog", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7203\/6958626585_ffbbb2d8f6_m.jpg", "height_s":"158", "width_s":"240"}, {"id":"6958682331", "owner":"55661684@N00", "secret":"d13b2dcc74", "server":"7068", "farm":8, "title":"SoHo London", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7068\/6958682331_d13b2dcc74_m.jpg", "height_s":"240", "width_s":"160"}, {"id":"6958683793", "owner":"55661684@N00", "secret":"85cf0e8bb1", "server":"7186", "farm":8, "title":"SoHo London", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7186\/6958683793_85cf0e8bb1_m.jpg", "height_s":"160", "width_s":"240"}, {"id":"6958638095", "owner":"16901621@N07", "secret":"9bc2e8ff61", "server":"7182", "farm":8, "title":"White Widow Maker", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7182\/6958638095_9bc2e8ff61_m.jpg", "height_s":"160", "width_s":"240"}, {"id":"6812573368", "owner":"55661684@N00", "secret":"e6ec40f6c6", "server":"7192", "farm":8, "title":"SoHo London", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7192\/6812573368_e6ec40f6c6_m.jpg", "height_s":"240", "width_s":"160"}, {"id":"6812557366", "owner":"43102195@N08", "secret":"9bd96b04f8", "server":"7179", "farm":8, "title":"Perhaps believing in good design is like believing in God, it makes you an optimist. --- Sir Terence Conran", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7179\/6812557366_9bd96b04f8_m.jpg", "height_s":"160", "width_s":"240"}, {"id":"6812561518", "owner":"57228413@N02", "secret":"6276e78e3c", "server":"7063", "farm":8, "title":"holland-park-62.jpg", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7063\/6812561518_6276e78e3c_m.jpg", "height_s":"160", "width_s":"240"}, {"id":"6812553526", "owner":"41219989@N08", "secret":"17338c5b9a", "server":"7061", "farm":8, "title":"IMG_3552", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7061\/6812553526_17338c5b9a_m.jpg", "height_s":"160", "width_s":"240"}, {"id":"6958681599", "owner":"55661684@N00", "secret":"c1ff0089dd", "server":"7192", "farm":8, "title":"SoHo London", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7192\/6958681599_c1ff0089dd_m.jpg", "height_s":"240", "width_s":"160"}, {"id":"6812558374", "owner":"43076356@N03", "secret":"e47f7954bb", "server":"7038", "farm":8, "title":"View of London", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7038\/6812558374_e47f7954bb_m.jpg", "height_s":"180", "width_s":"240"}, {"id":"6958673503", "owner":"57228413@N02", "secret":"810f3548f0", "server":"7068", "farm":8, "title":"holland-park-70.jpg", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7068\/6958673503_810f3548f0_m.jpg", "height_s":"240", "width_s":"160"}, {"id":"6812540476", "owner":"43102195@N08", "secret":"53ea9a99dd", "server":"7204", "farm":8, "title":"Perhaps believing in good design is like believing in God, it makes you an optimist. --- Sir Terence Conran", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7204\/6812540476_53ea9a99dd_m.jpg", "height_s":"240", "width_s":"160"}, {"id":"6812567766", "owner":"57228413@N02", "secret":"5fc3e25e0d", "server":"7048", "farm":8, "title":"holland-park-72.jpg", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7048\/6812567766_5fc3e25e0d_m.jpg", "height_s":"240", "width_s":"160"}, {"id":"6958657089", "owner":"43102195@N08", "secret":"ecdf4beee9", "server":"7055", "farm":8, "title":"Perhaps believing in good design is like believing in God, it makes you an optimist. --- Sir Terence Conran", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7055\/6958657089_ecdf4beee9_m.jpg", "height_s":"160", "width_s":"240"}, {"id":"6958668207", "owner":"43076356@N03", "secret":"7475f56a1c", "server":"7051", "farm":8, "title":"View of London", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7051\/6958668207_7475f56a1c_m.jpg", "height_s":"180", "width_s":"240"}, {"id":"6812540384", "owner":"64749744@N00", "secret":"049ab154a2", "server":"7069", "farm":8, "title":"London Parliament on the River Thames", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7069\/6812540384_049ab154a2_m.jpg", "height_s":"133", "width_s":"240"}, {"id":"6958668019", "owner":"43076356@N03", "secret":"b133eb67d7", "server":"7191", "farm":8, "title":"View of London", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7191\/6958668019_b133eb67d7_m.jpg", "height_s":"180", "width_s":"240"}, {"id":"6958667907", "owner":"43076356@N03", "secret":"bbf938402c", "server":"7184", "farm":8, "title":"View of London", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7184\/6958667907_bbf938402c_m.jpg", "height_s":"180", "width_s":"240"}, {"id":"6812543528", "owner":"23168109@N08", "secret":"7f28382007", "server":"7057", "farm":8, "title":"makes the bin stand out", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7057\/6812543528_7f28382007_m.jpg", "height_s":"240", "width_s":"161"}, {"id":"6958661403", "owner":"57228413@N02", "secret":"14e6d96c78", "server":"7185", "farm":8, "title":"holland-park-37.jpg", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7185\/6958661403_14e6d96c78_m.jpg", "height_s":"160", "width_s":"240"}, {"id":"6958664027", "owner":"57228413@N02", "secret":"193ce953e8", "server":"7044", "farm":8, "title":"holland-park-44.jpg", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7044\/6958664027_193ce953e8_m.jpg", "height_s":"240", "width_s":"160"}, {"id":"6812545598", "owner":"13087462@N02", "secret":"2104e14a2e", "server":"7208", "farm":8, "title":"", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7208\/6812545598_2104e14a2e_m.jpg", "height_s":"240", "width_s":"160"}, {"id":"6958652345", "owner":"23168109@N08", "secret":"6abdda76d3", "server":"7040", "farm":8, "title":"won't get an arguement from me...", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7040\/6958652345_6abdda76d3_m.jpg", "height_s":"161", "width_s":"240"}, {"id":"6958637301", "owner":"7974331@N02", "secret":"1697b2ca6b", "server":"7200", "farm":8, "title":"", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7200\/6958637301_1697b2ca6b_m.jpg", "height_s":"161", "width_s":"240"}, {"id":"6958646759", "owner":"64604741@N07", "secret":"54256888c4", "server":"7050", "farm":8, "title":"366 Project - #65", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7050\/6958646759_54256888c4_m.jpg", "height_s":"240", "width_s":"240"}, {"id":"6812528856", "owner":"38916598@N08", "secret":"c439539c04", "server":"7046", "farm":8, "title":"untitled-8889-Edit.jpg", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7046\/6812528856_c439539c04_m.jpg", "height_s":"240", "width_s":"180"}, {"id":"6812530852", "owner":"43102195@N08", "secret":"b2682b7372", "server":"7070", "farm":8, "title":"Arguably the only goods people need these days are food and happiness --- Sir Terence Conran", "ispublic":1, "isfriend":0, "isfamily":0, "url_s":"http:\/\/farm8.staticflickr.com\/7070\/6812530852_b2682b7372_m.jpg", "height_s":"160", "width_s":"240"}]}, "stat":"ok"}
这就是我尝试处理它的方式:
$.getJSON("http://api.flickr.com/services/rest/?method=flickr.photos.search&api_key=16ef7342398650e9b81d532f35af41be&tags=london&extras=url_s&format=json&nojsoncallback=1&api_sig=a94a3b963f2d398737a336cccf9a539b", displayImages)
function displayImages(imagesJSON)
{
var htmlImages =""
$.each(imagesJSON.photos, function(i, item){
htmlImages += "<img src=" + item.url_s + "><br>"
})
$("#myImages").html(htmlImages)
}
对于每次迭代,我得到“未定义”,并且我猜测我没有正确地阅读JSON结构。任何提示都将受到高度赞赏!
答案 0 :(得分:0)
这里看到这个小提琴,就像一个魅力: http://jsfiddle.net/7D2Tx/1/
$.each(imagesJSON.photos, function(i, item){
应该是
$.each(imagesJSON.photos.photo, function(i, item){
答案 1 :(得分:-1)
htmlImages += "<img src=" + item.url_s + "><br>"
应该是:
htmlImages += "<img src=" + item.photo.url_s + "><br>"
编辑:事实上,看看数组,它应该更像是这样:
function displayImages(imagesJSON)
{
var htmlImages =""
$.each(imagesJSON.photos, function(i, item){
// There are numerous photo objects within photos.
$.each(item.photo, function(o, item2){
htmlImages += "<img src=" + item2.url_s + "><br>"
})
});
$("#myImages").html(htmlImages)
}