Ticket #6664 (closed bug: worksforme)
parse error from jQuery.parseJSON(data)
| Reported by: | codylindley | Owned by: | |
|---|---|---|---|
| Priority: | Milestone: | 1.4.3 | |
| Component: | ajax | Version: | 1.4.2 |
| Keywords: | parse JSON ajax | Cc: | |
| Blocking: | Blocked by: |
Description
I am getting a JSON parse error using type JSON or TEXT in an ajax request. Yehuda helped me boil it down to this.
code:
jQuery.parseJSON('{"user":"userkey","addSchoolLink":{"text":"add school","id":"addSchoolBtn"},"schools":[{"rank":1,"name":"Aame of School 43214","schoolID":"987654","location":"town, state","vote":{"text":"login to vote","url":"url here","className":"loginToVoteBtn"}},{"rank":34,"name":"Bame of School 1321","schoolID":"123456","location":"town, state","vote":{"text":"vote for this school","url":"url here","className":"voteBtn"}},{"rank":34,"name":"Bame of School 1321","schoolID":"123456","location":"town, state","vote":{"text":"html that they already voted","url":false,"className":false}}]}')
For me this returns an error in every browser but FF?
Change History
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Wait...
looks like an encoding issue
http://gyazo.com/114e20324d1c4e82f56532acf8cf792f.png
finally got a validation tool to throw an error.