If your completly sure that it is save, you could just use eval:
eval("var myJSON = [{"carePacks": [{"businessCode":"J1PS","description":"HP
1"}],"coveragePeriod":12},{"carePacks":[{"businessCode":"J1PS","description":"HP
s"}],"coveragePeriod":13}];");
On Mon, Apr 27, 2009 at 10: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
-~----------~----~----~----~------~----~------~--~---