Thanks for the info Christophe! Unfortunately, I dont like to patch
source code in order to avoid creating other bugs.
However, you gave me an idea and I looked at the source to see if they
were simply using an eval (which I loathe to do usually), but, that is
what they appeared to use to convert JSON into a hash object. So, I
went with my original idea which is to simply do this:
var string = "{'name': 'Yogi Bear', 'position': 'pic-a-nic basket
collector'}";
var hashObj = $H(eval('(' + string + ')'));
This works, I just was hoping to avoid using an eval.
Thanks again for your help! Cheers!
On Feb 24, 11:03 am, Christophe Porteneuve <[EMAIL PROTECTED]> wrote:
> Hey there,
>
> sliver a écrit :
>
> > var string="{name: 'Yogi Bear', position: 'pic-a-nic basket
> > collector'}";
>
> If you just go the extra mile and put quotes around the key names,
> making it a valid JSON serialized form, you'll be able to leverage the
> new JSON features (including, of course, parseJSON) Tobie recently
> provided as a branch changeset [1]. They're likely to become available
> in the next point release. Until then, you can get Tobie's patch file
> and apply it over your copy of Prototype...
>
> [1]http://dev.rubyonrails.org/changeset/6210
>
> --
> Christophe Porteneuve a.k.a. TDD
> "[They] did not know it was impossible, so they did it." --Mark Twain
> Email: [EMAIL PROTECTED]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" 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/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---