-1

Example : Iam trying to access "53" key in Ajax. but not sure how to get it.

JSON : 
    {
        "56": {
            "0": {



     $.ajax({
        url: 'url',
        dataType: 'jsonp',
        success: function(json) {
            rates = json.56;
            //base = json.base;
            console.log(rates);
        }
    });

any help is appreciated.. Thanks !!

newToJS
  • 19
  • 5

3 Answers3

0

Use the bracket notation :

var rates = json["56"];
Denys Séguret
  • 372,613
  • 87
  • 782
  • 758
0

Try using brackets:

rates = json[56];

or

rates = json['56'];
0

You can use json[56] to access the value

AKT
  • 176
  • 2
  • 10