Quantcast
Channel: SambaClub Forum - Latest topics
Viewing all articles
Browse latest Browse all 8860

How to use variable to get data from JSON array

$
0
0

@sukasem wrote:

How can I use variable in script to get JSON data?

function GetItems(o,i,myVar) {
  var r = JSON.parse(Data.Get('Glf_Json'));
  if (type == "count") {
    return r.orders[o].items.length;
  } else {
    return r.orders[o].items[i].myVar
  }
}

I want to pass myVar to return r.orders[o].items[i].myVar

Posts: 28

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 8860

Trending Articles