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,582 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 .