Results 1 to 3 of 3

Thread: Sencha json Ajax request fails to fetch response and shows "origin null is not alowd

  1. #1
    Sencha User
    Join Date
    Nov 2011
    Posts
    21
    Vote Rating
    0
      0  

    Default Sencha json Ajax request fails to fetch response and shows "origin null is not alowd

    the following code fails to fetch the json response

    & it shows the error ---XMLHttpRequest cannot load https://meme.hcl.com/services/json. Origin null is not allowed by Access-Control-Allow-Origin.

    may i know the reason? pls reply....
    -------------------------------------------------------
    var con = new Ext.data.Connection();
    con.request({url:
    'https://meme.hcl.com/services/json', // where to do the request
    // jsonData: jsonData, // << key value object with data to send
    method:
    'POST',callback: function(opts, success, response) {if (!success) {// Ext.MessageBox.alert("Error",
    //"Error retrieving data - try again");
    alert(response.responseText);
    return;}//use the answer of the request, which is contained in response.responseText
    alert(response.responseText) }
    });

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Vote Rating
    1272
      0  

    Default

    If you are trying to load from a different domain than the one your app is on then you are restricted. You must use ScriptTag proxy or Ext.util.JsonP to get around the browser restrictions.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

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

  3. #3
    Sencha User
    Join Date
    Nov 2011
    Posts
    21
    Vote Rating
    0
      0  

    Default

    thanks it helps me

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •