1. #1
    Sencha User
    Join Date
    Jun 2009
    Posts
    84
    Vote Rating
    0
    nofx is on a distinguished road

      0  

    Default Ajax problems, status = 0

    Ajax problems, status = 0


    I'm trying to do an Ajax call to a .html page to get the content of it. But for some reason it gives me the following error:

    XMLHttpRequest cannot load http://www.domain.com/cms/info.html?_dc=1323771597793. Origin null is not allowed by Access-Control-Allow-Origin.

    faq.js:11server-side failure with status code 0

    When i browse directly to the url then i see that the url is valid and the content is displayed in my webbrowser. Any idea why i can't retrieve the data with my Ajax call??

    Code:
            Ext.Ajax.request({
                url: 'http://www.domain.com/cms/info.html',
                success: function(response, opts) {
                    alert('success');
                },
                failure: function(response, opts) {
                    console.log('server-side failure with status code ' + response.status);
                }
            });

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,714
    Vote Rating
    436
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    Ajax requests are prohibited by the browser to go across different origins. The only workaround is if you are wanting to transport JSON
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!

    When posting code, please use BBCode's CODE tags.