Just a quickie on parsing JSON strings in Safari.
Here is my JSON string (well, an example):Safari was choking on the
breakin the above JSON string. When I wrapped the attribute in single quotes, like so:
it was happy.
You can replicate this by using the below code snippet to parse out your JSON string quickly in Safari’s debug window:
fails. If you wrap
if in single quotes, it works.
I think the take away lesson is to always wrap your object attributes in a JSON string in single quotes, otherwise Safari will choke on it.