alisal
asked on
How to store Key, Value and use them later
I am receiving the following in a json file:
I need to read, split and store the key and value, create a dropdown using the value. Then upon user choice (on dropdown), I need to update the json using the key.
Any hint would be apreciated.
ownerProperty: User=0101|Name=kjhadf|kahdf=1|RefId=876234878234hg
I need to read, split and store the key and value, create a dropdown using the value. Then upon user choice (on dropdown), I need to update the json using the key.
Any hint would be apreciated.
"result" is an object which will contain fields whose names are those to the left of the equals sign and whose values are those to the right.
Knowing the field one can simply write "result.User", "result.IsAdmin" and so on.
Not knowing the fields you can enumerate them with a for loop. for(var key in obj) {.....}
Lots of details on Javascript objects here http://javascriptissexy.com/javascript-objects-in-detail/
inter alia - because there are literally thousands of web sites expounding the beauty of Javascript objects.
Knowing the field one can simply write "result.User", "result.IsAdmin" and so on.
Not knowing the fields you can enumerate them with a for loop. for(var key in obj) {.....}
Lots of details on Javascript objects here http://javascriptissexy.com/javascript-objects-in-detail/
inter alia - because there are literally thousands of web sites expounding the beauty of Javascript objects.
ASKER
I've requested that this question be deleted for the following reason:
Answers are all google search result, too general
Answers are all google search result, too general
You asked a question and got an answer. If it is not good enough or you need additional help, just ask. deletion is not on.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you
ASKER
I found a solution online:
Open in new window
it does work, but how do I access to each key and value?