1. #1
    Sencha User
    Join Date
    Dec 2013
    Posts
    84
    Answers
    6
    Vote Rating
    48
    Malte123 is infamous around these parts Malte123 is infamous around these parts

      0  

    Default Answered: Ext.Ajax.request response.status 0 but file is loaded

    Answered: Ext.Ajax.request response.status 0 but file is loaded


    Hey all :-)

    I try to load a file within base64 in ...

    PHP Code:
    Ext.Ajax.request({
                
    urlthis.configFileName,
                
    method'GET',
            
    //    binary: true,  // makes it more worse: no responseText in Output
                
    success: function(response) {
                    var 
    cfg Ext.decode(response.responseText);
                    
    loadSuccessHandler(cfg); // callback function given as param functioncall
                
    },
                
    failure: function(response) {
                  
    loadErrorHandler("Could not get "+this.configFileName+" - server response was " response.status); // this is 0
                  
    console.log(response); // 
                
    }
            }); 
    Output on console:
    XHR finished loading: "file:///Users/noman/Documents/workspace/fassade/tests/app/config/config.cfg?_dc=1388973757477".
    Could not get undefined - server response was 0
    |> Object
    In my opinion I shouldn't see content in responseText like this (if failure sayes status=0):
    HTML Code:
    responseText: WW91IGFyZSBhIHNub29weSBFeHRKUyBIZXJvIDotKQ0KUGxlYXNlIGhlbHAgbWUgdG8gZmluZCBhIHNvbHV0aW9uICENCkkgdm90ZSB5b3UgdXAgYW5kIHNlbGVjdCB0aGUgYmVzdCBhbnN3ZXIgb2YgY2F1c2UgIQ0KSWYgeW91IHZvdGUgbWUgYWxzbyB1cCBJIHdpbGwgcG9zdCBteSBzb2x1dGlvbiBpZiB0aGVyZSBpcyBubyBzb2x1dGlvbiBwb3N0ZWQgYnkgb3RoZXJzLg==
    If I activate the flag binary: true I will loose my responseText in Object (console.log .. see above)

    For this: Everything does the opposite thinks than I expected !!!

  2. This will only happen loading files directly off the filesystem. If you put this through a server it'll work fine.

    See the code for the parseStatus method of Ext.data.Connection. A code of 0 is treated as an error. This is not straightforward as 0 could mean success or failure and applies when a real status code is not available.

    If you really must work directly off the filesystem then you can override the relevant parts of Connection easily enough.

  3. #2
    Sencha User
    Join Date
    Jan 2013
    Location
    Germany, Freiburg i. Br.
    Posts
    26
    Answers
    2
    Vote Rating
    7
    StudentDaniel is on a distinguished road

      1  

    Default


    maybe you should use the failure-method to go forward with loadSuccessHandler(cfg);

  4. #3
    Sencha User
    Join Date
    Jan 2013
    Location
    Germany, Freiburg i. Br.
    Posts
    26
    Answers
    2
    Vote Rating
    7
    StudentDaniel is on a distinguished road

      1  

    Default


    try scope: this ... so your undefined should go away .. maybe this helps

  5. #4
    Sencha User
    Join Date
    Dec 2013
    Posts
    84
    Answers
    6
    Vote Rating
    48
    Malte123 is infamous around these parts Malte123 is infamous around these parts

      0  

    Default


    scope: this ... so your undefined should go away
    thanks for this Idea
    but this only results in

    XHR finished loading: "file:///Users/noman/Documents/workspace/fassade/tests/app/config/config.cfg?_dc=1388973757477".
    Could not get app/config/config.cfg - server response was 0
    |> Object
    it doesn't fix the main Problem

  6. #5
    Sencha User
    Join Date
    Jan 2013
    Location
    Germany, Freiburg i. Br.
    Posts
    26
    Answers
    2
    Vote Rating
    7
    StudentDaniel is on a distinguished road

      1  

    Default


    Is there a solution for this ? Or is this a bug ?
    I am interested in this - I could reproduce this !

  7. #6
    Sencha User skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,338
    Answers
    498
    Vote Rating
    248
    skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of

      2  

    Default


    This will only happen loading files directly off the filesystem. If you put this through a server it'll work fine.

    See the code for the parseStatus method of Ext.data.Connection. A code of 0 is treated as an error. This is not straightforward as 0 could mean success or failure and applies when a real status code is not available.

    If you really must work directly off the filesystem then you can override the relevant parts of Connection easily enough.

  8. #7
    Sencha User
    Join Date
    Dec 2013
    Posts
    84
    Answers
    6
    Vote Rating
    48
    Malte123 is infamous around these parts Malte123 is infamous around these parts

      0  

    Default


    This will only happen loading files directly off the filesystem. If you put this through a server it'll work fine.
    thanks for clarification

Thread Participants: 2

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