concatenate two json objects !!

1,468 views
Skip to first unread message

nithin

unread,
Mar 17, 2008, 12:43:55 PM3/17/08
to json-taglib
Do we have any functionality in the tag lib to concatenate two json
objects.

Here is the example.

i have jsonObject 1:
{
itemCount: 1,
items:[
{
title: "The Big Book of Foo",
description: "Bestselling book of Foo by A.N. Other",
imageUrl: "/images/books/12345.gif",
price: "$10.00",
qty: 1
}
]
}

i have another jsonObject 2 :

{
itemCount: 1,
items:[
{
title: "The Big Book of Foo",
description: "Bestselling book of Foo by A.N. Other",
imageUrl: "/images/books/12345.gif",
price: "$10.00",
qty: 1
},
]
}

I want to concatenate the values of items array in jsonObject 1 and
jsonObject 2.

Concatenated json Object ahould look like this,

{
itemCount: 1,
items:[
{
title: "The Big Book of Foo",
description: "Bestselling book of Foo by A.N. Other",
imageUrl: "/images/books/12345.gif",
price: "$10.00",
qty: 1
},
{
title: "Javascript Pocket Reference",
description: "Handy pocket-sized reference for the Javascript
language",
imageUrl: "/images/books/56789.gif",
price: "$5.50",
qty: 1
}
]
}


Could any body help me, if this is possible using jsonTag Lib.

Thanks in advance..
Reply all
Reply to author
Forward
0 new messages