SZH SZH - 1 year ago 123
JSON Question

Ruby on Rails JSON.parse unexpected token error

I am trying to parse JSON data in my Rails 3 application with

. I keep getting this error:

737: unexpected token at
absolute; top: 8px; left: 8px; width: 560px; height: 290px; z-index:
0; \"}

The actual JSON is a lot longer, but it is basically the same.

Answer Source

Well, we can only answer based on the part of the JSON you showed us, but it has two problems:

  1. All the quote characters (") are escaped; they don't need to be unless they are used in a double-qoted string, which it appears they are not.
  2. You are missing a closing brace (}).

Otherwise it passes based on

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download