Bug Tracker

Modify

Ticket #6664 (closed bug: worksforme)

Opened 3 years ago

Last modified 3 years ago

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

comment:1 Changed 3 years ago by codylindley

Wait...

looks like an encoding issue

 http://gyazo.com/114e20324d1c4e82f56532acf8cf792f.png

finally got a validation tool to throw an error.

comment:2 Changed 3 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to worksforme

When I copy/pasta that into jsonlint it works. It might be a strange non-Unicode encoding of a char.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.