Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript AJAX Basics (retiring) Programming AJAX Processing JSON Data

Error Parsing JSON

In the AJAX basics course I'm trying to do one of the exercises but I keep getting this error in my console:

SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data widget.js:4:20

Is it possible the JSON file for this exercise is not formatted correctly?

2 Answers

Tobias Helmrich
Tobias Helmrich
31,602 Points

Hey Nathaniel,

it would be helpful to know which exercise you're trying to do in particular and how your code looks like to exclude the possibility that something's wrong with your code. To me the JSON file looks perfectly fine and I also let it run through JSONlint which says that everything is fine as well.

Just remove the white space on line 1 column 1 in employees.jason file. The white space is before the square bracket .