The only legal way is :
if ('undefined' === typeof JSON)
$.getScript("http://www.json.org/json2.js", proceed );
function proceed ()
{
var obj = JSON.parse(
'[{"carePacks":[{"businessCode":"J1PS","description":"HP
1"}],"coveragePeriod":12},{"carePacks":
[{"businessCode":"J1PS","description":"HPs"}],"coveragePeriod":13}]'
)
}
-- DBJ
On Apr 27, 9:13 am, gaohk <[email protected]> wrote:
> I have a string that is like [{"carePacks":
> [{"businessCode":"J1PS","description":"HP 1"}],"coveragePeriod":12},
> {"carePacks":[{"businessCode":"J1PS","description":"HP
> s"}],"coveragePeriod":13}].
> can you give me some advice on how to convert it to a json structure,
> and how to get data from the data structure, like get "HP 1".
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---