I'm working on a backbone.js project and I'm calling my github repo. I have the my Collections and Models bootloaded so they exist once my page is built, but when I call model.fetch() I get this message: (replace :username with a username)
XMLHttpRequest cannot load https://api.github.com/users/:username.
Origin http://mydomain.com is not allowed by Access-Control-Allow-Origin.
I've read a few messages post1, post2, they mention modifying the backbone.sync function but I'm not entirely sure how. Here is my code so far (this is in my Backbone.Router):
userDetails: function(id) {
console.log('Loading: userDetails');
var User = Users.get(id);
User.fetch({dataType: "jsonp"});
console.log(User);
userView = new UserView({
model: User
});
userView.render();
},
Thanks!