2013-05-14 71 views
1

我正在使用谷歌電子表格api從JavaScript中的谷歌表讀取。我需要閱讀谷歌片請求谷歌電子表格時簡單的JSON格式

而且我想結果是這樣的:

result = [ { 
     Title : 'Item1', 
     Description : 'The items in this list are read dynamically from an external file for now. We can specify the Title, the description and the url of icon image.', 
     Icon : 'http://icons.iconarchive.com/icons/dapino/medical/128/medical-suitecase-icon.png' 
    }, 
    { 
     Title : 'Item2', 
     Description : 'Some Long description to check how the text will appear if it is too long in the info list view. It should wrap automatically and the height of the row should be adjusted as needed. I will add some more worlds.', 
     Icon : 'http://icons.iconarchive.com/icons/dapino/summer-holiday/128/compass-icon.png' 
    }, 
    { 
     Title : 'Item3', 
     Description : 'The pc icon is just a test icon. It can be replaced by any image local or on the server. I just used this one for testing.', 
     Icon : 'http://icons.iconarchive.com/icons/gabriel-leblanc/historic-mac/128/ibook-g4-12-icon.png' 
    }, 
    { 
     Title : 'Item4', 
     Description : 'Adding a final item that will be out of range of the view. You will have to scroll to see it. (at least on the iphone)', 
     Icon : 'http://icons.iconarchive.com/icons/double-j-design/ravenna-3d/128/V-Card-icon.png' 
    } 
]; 

當我使用這個網址作爲JSONP請求該紙張,作爲一個JSON:

我得到一個Json很雜亂。有沒有一種方法可以修改網址以返回類似於我想要的內容?或者更簡單一些。我發現很難從返回的Json中提取值

+0

謝謝回答你的人。 – Hugolpz

回答

0

您可以使用javascript將返回的json更改爲所需的格式...如果您想要一種無代碼的方式,我很抱歉,但json看起來與GData API輸出相同。所以你的選擇看起來非常有限。使用上面的json或HTML看起來是最好的選擇。

相關問題