-
23 Jan 2013 8:26 AM #1
XMLHttpRequest cannot load (..) What's this?!
XMLHttpRequest cannot load (..) What's this?!
Hi,
Does anyone know how that it is this error?!
I'm making a request to the API of the weather yahoo, but I can not. write down the code and the error!
My Code:
Ext.Ajax.request({
url: 'http://weather.yahooapis.com/forecastrss',
method: 'GET',
disableCaching: false,
params: {
w: '2502265',
u: 'c'
},
callback: function(response) {
console.log(response.responseText);
}
});
-------------------------------------------------------------------------------------
Error (that appears in the console):
XMLHttpRequest cannot load http://weather.yahooapis.com/forecastrss?w=12867727&u=c. Origin http://localhost is not allowed by Access-Control-Allow-Origin.
Someone help?
Thanks!
Best Regards,
Hugo Trigo
-
23 Jan 2013 11:26 AM #2
http://en.wikipedia.org/wiki/Same_origin_policy
If you want to make cross domain requests you will need to look into CORS or use JSONP.
This is a security restriction of the web browser.Aaron Conran
@aconran
Sencha Architect Development Team
-
24 Jan 2013 1:56 AM #3
Ok I will explore this question, thanks. Give news soon!



Reply With Quote