javascript - Fetching reddit comments using JSONP in backbone returns HTML -
I am using the Reddit API to populate the model and compilation in a backbone.js app.
To store the collection, I have used a JSONP request in the sync method which works great:
Archive:
Sync: Function (method, model, option) {var Params = _.extend ({type: 'GET', datatype: 'jsonp', url: 'http://www.reddit.com/r/gif/.json&jsnp = ', Process data: wrong}, option); $ Console.log ('Fetching for Collection') $. Returns AJAX (Param); },
However, when I use the same technique to bring a personal link, the response is HTML and not JSON.
Model:
Sync: Function (method, model, option) {var params = _.extend ({type: 'GET', datatype: 'jsonp', Url: 'http://www.reddit.com/r/ Gif / comments / 1y1edn / .json and jsonp =', process data: wrong}, options); Console.log ('Fetching for Model') Refund $. Ajax (params); },
Why does the reddit API return to the HTML and HTML for the model?
This is discussed in your comment on the question, but the error is that you can not read ;
, ? You are not using
, URL in the URL ( /r/gif/comments/xxxxxx/.json
) to ?
needs to isolate the query parameter ( jsonp = some_js_func
) .
Comments
Post a Comment