I am on a site trying to grab some json data from my node.js server serving port 8080.
I get this error message:
XMLHttpRequest cannot load http://site.com:8080/json/1. Origin http://site.com is not allowed by Access-Control-Allow-Origin.
my code is:
$.get('http://site.com:8080/1/', {}, function (Data) { console.log(Data); }, "json");
But this is the same domain !: (
Also consider my backbone.js model:
model = Backbone.Model.extend({ url: function() { return 'http://site.com:8080/' + this.id } });
Is there any way to resolve this other than using jsonp?
Thanks.
FriiSource
source share