JSON key from variable
Posted: Thu Mar 04, 2010 11:02 am
Code: Select all
var key = "b";
var json = {
"a": "first",
"b": "second",
"c": "third"
};
Code: Select all
alert(json.key);
But i don't know how to do it.
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
var key = "b";
var json = {
"a": "first",
"b": "second",
"c": "third"
};
Code: Select all
alert(json.key);