0
奇錯誤
我試圖運行下面的jQuery:與USTREAM JSON API和jQuery
var query = 'http://api.ustream.tv/json/channel/masaiblog/getValueOf/status?jsonp=?';
$.getJSON(query, function(data)
{
if (data['results'] == 'live')
{
alert('ITS LIVE!');
}
});
很簡單,不是嗎?它轉到Ustream API,獲取JSON數據,檢查results
值是否等於live
,並提醒用戶是否爲。然而,當我運行它,而不是因爲它應該工作,我得到一個錯誤:
{"results":"live","msg":null,"error":null,"processTime":true,"version":"mashery-r10"}
Uncaught SyntaxError: Unexpected token :
我使用非常相似的代碼來Justin.TV和偉大工程。
這就是它,謝謝。 – 2011-03-29 01:44:06