Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Sencha User
    Join Date
    Oct 2011
    Posts
    127
    Vote Rating
    0
    robl is on a distinguished road

      0  

    Exclamation Ajax/JSONP request doesn't work..

    Ajax/JSONP request doesn't work..


    I am trying to call a remote server that returns JSON using Ajax. I am using ST 2.0.0pr1 and phonegap 1.1.0.

    I do not understand why this doesn't work:

    Code:
           Ext.Ajax.request({
                url: url,
                success: function(response) {
                    console.log(response);
                    // process server response here
                }
            });
    while this does:

    Code:
               var ajax = new XMLHttpRequest();
               ajax.open("GET",url,true);
               ajax.send();           ajax.onreadystatechange=function(){
                console.log('ajax response!');
                if(ajax.readyState==4 && (ajax.status==200)){
                 console.log('200 response!')
                 console.log(ajax.responseText);
               }

  2. #2
    Ext JS Premium Member
    Join Date
    Jun 2010
    Posts
    1
    Vote Rating
    0
    jedi is on a distinguished road

      0  

    Default


    hi,

    this is probably due to the new whitelist feature of phonegap. if you're working on xcode you should be able to add domain names in file PhoneGap.plist (under <project name>/Supporting Files). there's a section called ExternalHosts. add your remote domains there (wildcards work).

    here's a screenshot: http://www.prosoxi.com/2011/10/08/xc...ist-rejection/
    @wuher

  3. #3
    Sencha User
    Join Date
    Oct 2011
    Posts
    127
    Vote Rating
    0
    robl is on a distinguished road

      0  

    Default


    Unfortunately, that's not the problem because I already have the server host name in the whitelist and it works with a straight Javascript AJAX request.

  4. #4
    Sencha - Community Support Team jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,337
    Vote Rating
    75
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    I'll be honest. I don't think that this is a Sencha touch issue. Try using this inside of mobile safari. Does it work? Also, try setting a failure callback and inspecting the results.

  5. #5
    Sencha User
    Join Date
    Oct 2011
    Posts
    127
    Vote Rating
    0
    robl is on a distinguished road

      0  

    Default


    Quote Originally Posted by jgarcia@tdg-i.com View Post
    I'll be honest. I don't think that this is a Sencha touch issue. Try using this inside of mobile safari. Does it work? Also, try setting a failure callback and inspecting the results.
    Thanks. So my above code looks right?

    And should the failure callback look like this below?

    Code:
    failure:  function(response) {                console.log(response);                // process server response here            }

  6. #6
    Touch Premium Member
    Join Date
    Nov 2007
    Posts
    38
    Vote Rating
    0
    knifegun is on a distinguished road

      0  

    Default


    I also think this has to be an issue with whitelisting and/or issues with your code. I can run Sencha Touch 2 via PhoneGap 1.1 on iOS. It makes JSONP calls successfully.

  7. #7
    Sencha - Sencha Touch Dev Team rdougan's Avatar
    Join Date
    Oct 2008
    Posts
    1,158
    Vote Rating
    6
    rdougan will become famous soon enough

      0  

    Default


    I heard reports of this at SenchaCon too. Moving this to the bug forum so we can investigate and verify.

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar