1. #1
    Sencha User
    Join Date
    Jan 2013
    Posts
    42
    Vote Rating
    0
    HugoTrigo is on a distinguished road

      0  

    Default 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

  2. #2
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,413
    Vote Rating
    129
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    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

  3. #3
    Sencha User
    Join Date
    Jan 2013
    Posts
    42
    Vote Rating
    0
    HugoTrigo is on a distinguished road

      0  

    Default


    Ok I will explore this question, thanks. Give news soon!

Thread Participants: 1

Tags for this Thread