Collect value of a return

2
{"finalOFX":{"0":"276.67"},"0":null}

So it is returning from PHP, as in javascript I give alert and only display 276.67 I've tried alert(dados.finalOFX) , but Object: Object appears

    
asked by anonymous 13.03.2015 / 20:55

2 answers

2

You must access the properties of the object, with dados being the object that contains: {"finalOFX":{"0":"276.67"},"0":null} , finalOFX the object that contains: {"0":"276.67"} and 0 the object containing "276.67"

You should do something similar to this:

var dados = {"finalOFX":{"0":"276.67"},"0":null};

alert(dados.finalOFX["0"]);
    
13.03.2015 / 20:59
2

Just select which key you want, in this case it is 0 .

Example:

alert(dados.finalOFX[0]);
    
13.03.2015 / 20:58