I have a js file X which has a json object in which I want to pass the object to another js file Y and execute according to the values of the object. These two js files are referenced to the same html page.
The json object is something like this
var displayDetails = {
"A" : {
data : "1",
display : "A1"
},
"B" : {
data : "2",
display : "B2"
}
};
After which the json object was parsed
var cachedOptions = JSON.parse(JSON.stringify(displayDetails));
All this are in js file X. So how do I access that cachedOptions or displayDetails on js B? I am new to json so any help is appreciated. Thanks!