Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Javascript] How to add a record to a Json data object?


  • From: rdong at advance.net (Roland Dong)
  • Subject: [Javascript] How to add a record to a Json data object?
  • Date: Sun Jun 26 18:49:48 2005

I have been trying to add a record the the following json data object using
javascript.

var jsonObj = {

	"name":"horizontal navigation",
	"menu": [
		{"Label_1": "a", "url":"http://abc";, "test":false },
		{"Label_1": "b", "url":"http://cde";, "test":false},
		{"label_2": "e", "url":"http://fgh";, "test":true},
		{"label_2": "f", "url":"http://ijk";, "test":false},
		{"label_3": "g", "url":"http://lmn";, "test":false},
		{"label_4": "h", "url":"http:/opq",  "test":false}
           ]
};


I want to add a record: {"label_4":"I", "url":"http://rst";, "test":true} to
menu.  How can I do it? 

Thanks you.