內容簡介
非常簡單的外掛。新增了一種可訂閱的新型態 feed。只需在正常 feed 的任何地方添加 ?feed=json,即可獲得 JSON 格式的內容(但只有活動的縮小版本)。
版本 1.1 新增了對 JSONP 的支援。若想要獲得 JSONP 回應而非一般 JSON 結構,只需在查詢中添加 jsonp=callbackName,其中 callbackName 是要包覆的函式名稱。
想要使用 jQuery時,可以使用以下方式:
$.getJSON("http://example.com/feed/?feed=json&jsonp=?",
function(data){
console.debug(data[0].title); // print title of first item to firebug console
});
});
(感謝 Dan “Tack” Trudell)
外掛標籤
開發者團隊
原文外掛簡介
Pretty simple, really. Adds a new type of feed you can subscribe to. Simply
add ?feed=json to anywhere you get a normal feed to get it in JSON form
(but with a cutdown version of events).
Version 1.1 added support for JSONP. To get a JSONP response instead of a
normal JSON structure, simply add jsonp=callbackName to your query, where
callbackName is the name of the function to be wrapped with.
To use this with jQuery, you’ll want to do something like:
$.getJSON("http://example.com/feed/?feed=json&jsonp=?",
function(data){
console.debug(data[0].title); // print title of first item to firebug console
});
});
(thanks to Dan “Tack” Trudell)
