1. #1
    Sencha User
    Join Date
    Dec 2011
    Posts
    5
    Vote Rating
    0
    sieppl is on a distinguished road

      0  

    Default Android 2.3.3. JSON bug (JSON string twice in responseText)

    Android 2.3.3. JSON bug (JSON string twice in responseText)


    Hi all,

    we bumped in a very strange bug on Android 2.3.3.
    All ajax calls that expect a JSON object fail with "Unable to parse the JSON returned by the server.." due to a doubled JSON string. So instead of
    Code:
    {"key":"value"}
    the reponseText contains
    Code:
    {"key":"value"}{"key":"value"}
    On Android 2.1 and Android 3.1 this problem does not occur.

    Can anybody confirm this behavior?

    Best Regards
    Sebastian

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,522
    Vote Rating
    814
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    The response has the double object? If so then that is not valid JSON and therefor not consumable.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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 in print!

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

  3. #3
    Sencha User
    Join Date
    Dec 2011
    Posts
    5
    Vote Rating
    0
    sieppl is on a distinguished road

      0  

    Default


    Quote Originally Posted by mitchellsimoens View Post
    The response has the double object? If so then that is not valid JSON and therefor not consumable.
    Yes, correct. The bug occurs due to an OPTION request sent in chrome browsers. We fixed this by
    Code:
    Ext.Ajax.useDefaultXhrHeader = false;
    and responding only to POST and GET on ther server.

Thread Participants: 1