1. #1
    Sencha User
    参加日付
    Apr 2011
    投稿数
    2
    Vote Rating
    0
    Racon is on a distinguished road

      0  

    Question Access-Control-Allow-Origin

    Access-Control-Allow-Origin


    XMLHttpRequest cannot load http://xyz. Origin http://localhost is not allowed by Access-Control-Allow-Origin.

    I get this Exception in my Chrome Browser.

    The server I run is Apache (XAMPP).

    How can I fix this? What can I do?

    Thank you very much

    My Source Code:

    <script type="text/javascript">

    new Ext.Application({

    name: 'Hello World',

    launch: function() {



    Ext.Ajax.request({

    url: 'http://xyz',

    method: 'GET',

    headers: {'Authorization': 'Basic GVU0IXZ6cFGzczE='},

    success: function(response, opts) {

    var obj = Ext.decode(response.responseText);

    console.dir(obj);

    },

    failure: function(response, opts) {

    console.log('server-side failure with status code ' + response.status);

    }

    });



    }

    });

    </script>

  2. #2
    Sencha User
    参加日付
    Nov 2010
    位置
    Norway
    投稿数
    56
    Vote Rating
    1
    aCa is on a distinguished road

      0  

    デフォルト


    Take a look as JSONP and ScriptTagProxy. Also read this wiki page: http://en.wikipedia.org/wiki/Same_origin_policy.

  3. #3
    Sencha User
    参加日付
    Aug 2010
    位置
    Europa
    投稿数
    216
    Vote Rating
    1
    kortovos is on a distinguished road

      0  

    デフォルト


    Or you can use a PHP proxy

  4. #4

    デフォルト


    引用 aCaにより最初に投稿 投稿を見る
    Take a look as JSONP and ScriptTagProxy. Also read this wiki page: http://en.wikipedia.org/wiki/Same_origin_policy.

    I think he is right. You should probably try Ext.util.JSONP.request() instead and see if that works out for you

  5. #5

    デフォルト


    引用 Raconにより最初に投稿 投稿を見る
    XMLHttpRequest cannot load http://xyz. Origin http://localhost is not allowed by Access-Control-Allow-Origin.

    I get this Exception in my Chrome Browser.

    The server I run is Apache (XAMPP).

    How can I fix this? What can I do?

    Thank you very much

    My Source Code:

    <script type="text/javascript">

    new Ext.Application({

    name: 'Hello World',

    launch: function() {



    Ext.Ajax.request({

    url: 'http://xyz',

    method: 'GET',

    headers: {'Authorization': 'Basic GVU0IXZ6cFGzczE='},

    success: function(response, opts) {

    var obj = Ext.decode(response.responseText);

    console.dir(obj);

    },

    failure: function(response, opts) {

    console.log('server-side failure with status code ' + response.status);

    }

    });



    }

    });

    </script>
    Hi Racon.
    If you are trying to get data from a domain that is not your businness you have to use JSONP due to the same origin policy.
    However, If you are developing an application on localhost that you will upload on the same domain you are trying to get data from, you don't need to use JSONP!
    In this case you only need to open you application from file://.... intead of http://localhost/...
    This will makes the trick and will allow you to get data from a different domain.

    Hope this helps.
    Sencha Inc
    Andrea Cammarata, Solutions Engineer
    CEO at SIMACS

    @AndreaCammarata
    www.andreacammarata.com
    github: https://github.com/AndreaCammarata

    TUX components bundle for Sencha Touch 2.x.x
    http://www.tux-components.com/


Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi