Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Sep 2011
    Posts
    1
    Vote Rating
    0
    joelmay is on a distinguished road

      0  

    Default HTTP status of 0 prevents json from loading in phonegap

    HTTP status of 0 prevents json from loading in phonegap


    When loading json locally (file://) or in phonegap, the http status in xhdr is zero. The sencha js interprets this as an error an fires an exception event rather than accepting the data and calling the store.load callback.

    Note: In Adobe Flash, when loading xml locally, I also get a zero http status code, but flash still fires the 'complete' event and everything works fine.

    Here is my work around: In the function Ext.data.Connection.onComplete, I've changed the first if statement to:



    if ((status >= 200 && status < 300) || status == 304 ||
    (status == 0 && r.xhr.responseText.length > 0) ) {

    There might be a better way to do this, but it seems to work for me.

    Joel May

    Edit: Sorry I did not follow the proper format. I neglected to read the rules before I posted this.
    Anyway, I see this is an iphone/ipad universal phonegap app. I'm using the most recent versions of sencha-touch and phonegap. I am seeing this behavior in the simulator. I also see it in the safari desktop browser when NOT running in localhost (i.e. file://). I have not tested on the actual device yet, but I expect it to be a problem there also.

  2. #2
    Sencha User
    Join Date
    Sep 2011
    Posts
    2
    Vote Rating
    0
    pat777 is on a distinguished road

      0  

    Question


    Hi,


    is there any new information available regarding this topic?


    I had the same problem and joelmay's fix worked fine for me (thanks for posting)...


    Pat

  3. #3
    Sencha User
    Join Date
    Jan 2009
    Posts
    7
    Vote Rating
    0
    yannah is on a distinguished road

      0  

    Thumbs up offline json solved

    offline json solved


    hi,

    to all who have a problem using their offline json in Sencha/Phonegap/Android environment -- this definitely solved that problem.

    tnx guys.

  4. #4
    Sencha User
    Join Date
    Nov 2007
    Posts
    38
    Vote Rating
    0
    mraible is on a distinguished road

      0  

    Default Fix required for Sencha Touch 2 with PhoneGap as well

    Fix required for Sencha Touch 2 with PhoneGap as well


    I've confirmed this is necessary with Sencha Touch 2 as well. To fix, I changed Connection.js, line 755, from:

    Code:
    result = me.parseStatus(request.xhr.status);
    To:

    Code:
    if (request.xhr.status == 0 && request.xhr.responseText.length > 0) {
      result = {success: true, isException: false}
    } else {
      result = me.parseStatus(request.xhr.status);
    }

Thread Participants: 3

Tags for this Thread

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