dkim18
asked on
how to add/modify Json data(file) using javascript/jquery/ajax?
Hi,
Is there a way to modify the json data using javascript/jquery/ajax?
Q1)
I need to add additional properties to the json data.
ex)
I need to add 'parent':'xxxx'
I get the json data from the web service call.
can you show me an example or tutorial how I can do this please?
I must be looking at wrong place and can't find any examples.
Thanks.
Is there a way to modify the json data using javascript/jquery/ajax?
Q1)
I need to add additional properties to the json data.
ex)
[
{ 'text': 'john doe', 'age':'29', 'id':'123', 'uri': 'xxxxx'},
{ 'text': 'jane doe', 'age':'22', 'id':'122', 'uri': 'xxxxx'},
{ 'text': 'joe doe', 'age':'12', 'id':'121', 'uri': 'xxxxx'}
]
I need to add 'parent':'xxxx'
I get the json data from the web service call.
can you show me an example or tutorial how I can do this please?
I must be looking at wrong place and can't find any examples.
Thanks.
ASKER
$(json).each(function(i,el em) {
are i and elem the builtin(??) property name or did you make them up?
also is json variable a json object or array?
I get confused on that.
Thanks.
are i and elem the builtin(??) property name or did you make them up?
also is json variable a json object or array?
I get confused on that.
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window
If you want to loop through all the records, then like this:Open in new window