Forum

JSON Objects, keys and values

27 October 2017 14:29
Im having a moment of confusion. While attempting to dynamically change a value / key of the json data I cannot figure out how to reference the variable which it is stored in. For example, if the data were like so

var mydata = {
"firstName": "John",
"address": {
"streetAddress": "21 2nd Street"
}
};

I could simply mydata.address.streetAddress, however the json data loaded is as follows prior to be loaded without a variable.

{
"firstName": "John",
"address": {
"streetAddress": "21 2nd Street",
}
}

Is it being stored within B4W as a variable during runtime, does the json data need to be parsed prior to modifying, and will that even be allowed once the json file is already loaded via webplayer. If it is not allowed, is there a possibility to store the json data as a variable prior to the webplayer loading it so it can be manipulated afterwards?
 
Please register or log in to leave a reply.