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) jQuery and AJAX Stage 3 Challenge

kevinthecoder
kevinthecoder
10,791 Points

Syntax errors in line one(1) of JSON files using Firefox

Alright, so despite the code working correctly, I did notice in my Firefox(37) javascript console that I always get a generic syntax error pointing to the first line in both .json files. Again, let me be clear that all code runs correctly. I noticed this as well while running other good code while in the AJAX course and again only for the .json files. The javascript console error says 'syntax error' and points to line 1 of both the employee.json and rooms.json files. Yet, I don't see any issues in line one of those files. Line one simply has the opening bracket '[' .

Any ideas? It's not critical but it would be nice to know why I'm getting the syntax errors.

1 Answer

Tom Sager
Tom Sager
18,987 Points

I get the exact same behavior. Firefox reports a syntax error; Chrome, Opera and Vivaldi do not

I also tried a couple of online JSON parsers and none of them complained [http://json.parser.online.fr/, http://jsonlint.com/, https://www.jsoneditoronline.org/].

It looks like a Firefox quirk to me.