Skip to content

Instantly share code, notes, and snippets.

@jackfranklin
Created August 16, 2012 18:52
Show Gist options
  • Save jackfranklin/3372612 to your computer and use it in GitHub Desktop.
Save jackfranklin/3372612 to your computer and use it in GitHub Desktop.
var PostsCollection = B.Collection.extend({
model: PostModel,
url: "http://hndroidapi.appspot.com/news/format/json/page/",
fetch: function(cb) {
var ajaxReq = $.ajax({
url: this.url,
type: "GET",
dataType: "jsonp"
});
ajaxReq.done(function(d) {
console.log("DONE", d);
});
ajaxReq.error(function(d) {
console.log("ERROR", d);
});
(cb && typeof cb == "function" && cb());
}
});
// Get the error
// Uncaught SyntaxError: Unexpected token : hndroidapi.appspot.com:1
//hurl.it says the URL is fine: http://hurl.it/hurls/98417427b23fa1d963487dcc11211fe791727aba/31c24d1c394c06ec596a83b9c066abd00be441be
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment