1. #1
    Sencha User
    Join Date
    Oct 2012
    Posts
    62
    Vote Rating
    0
    sendy is on a distinguished road

      0  

    Default retrieve json data from Ext.Ajax.request ????

    retrieve json data from Ext.Ajax.request ????


    Hy,
    I want to retrieve latitude and longitude from
    [{"latitude":"36.7708","longitude":"10.2272"},{"latitude":"36.8188","longitude":"10.166"},{"latitude":"36.8188","longitude":"10.166"}]




    This is the code:
    Ext.Ajax.request({
    url: 'http://localhost/UniversiteCakeUploadEssai/app/webroot/getPositions.php',
    method: 'post',
    withCredentials: true,

    params: {
    classe:classe

    },

    success: function (response) {

    var positionResponse = Ext.JSON.decode(response.responseText);
    console.log(positionResponse);//it render Object {status: "success", message: "[{"latitude":"36.7708","longitude":"10.2272"},{"la…66"},{"latitude":"36.8188","longitude":"10.166"}]"}
    var msg=positionResponse.message;
    console.log(msg);// [{"latitude":"36.7708","longitude":"10.2272"},{"latitude":"36.8188","longitude":"10.166"},{"latitude":"36.8188","longitude":"10.166"}]


    if (positionResponse.status === "success") {
    console.log(positionResponse.message['latitude']); //undefined



    me.sessionToken = positionResponse.sessionToken;

    console.log('Success');
    }
    else {

    console.log('Failure');

    }
    },
    failure: function (response) {
    me.sessionToken = null;
    me.signInFailure('Login failed. Please try again later.');
    }
    Please how can I retrieve latitude and longitude for each user ????

    });

  2. #2
    Sencha Premium Member
    Join Date
    Feb 2012
    Location
    Berne, Switzerland
    Posts
    714
    Vote Rating
    42
    ingo.hefti has a spectacular aura about ingo.hefti has a spectacular aura about ingo.hefti has a spectacular aura about

      0  

    Default


    how about
    Code:
    console.log(positionResponse.message[0].latitude);
    message is an array with 3 objects. with ...message[0] we get the 1. object.

Thread Participants: 1

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..."