0

I'm a noobie, and I'm trying to achieve the following:

I have a dropdown with 3 values, and I have a JSON file. I stored the JSON file in my window object window.JsonObject. If we console log the window.JsonObject we see this below:

{
"Name1" = 'John',
"Name2" = 'Steve',
"Name3" = 'Andie'
}

What I'm trying to do, is to access this object like window.JsonObject.Name1 into a function, where Name is coming as a selected value from a dropdown.

I tried something like this: window.JsonObject + $('.selected) but not working.

How can I call it as window.JsonObject.$someVar in my JS code, where $someVar is 'John'?

Thank you

Cicharito
  • 121
  • 3
  • 15

0 Answers0