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 trialDavid Palmer
5,453 PointsUncaught SyntaxError: Unexpected Identifier
Hello: In AJAX Basics – A Simple AJAX Example Workspace, executing the ‘example1.html gives the following errors in the console log: Uncaught SyntaxError: Unexpected Identifier (Index):11 Uncaught ReferenceError: sendAJAX is not defined at HTMLButtonElement.onclick ((Index):31)
Please advise.
Thanks!
1 Answer
Jamela Peterson
2,983 PointsI got the same error. But, I'm not sure what is wrong. Here is a snapshot: https://w.trhou.se/kxycpzkz4l
Mark Wilkowske
Courses Plus Student 18,131 PointsHi Jamela, fixing these two errors will make you code work.
- Line 12 the if statement is open because it needs the closing }
- On line 18 the style property value should use single quotes --> style.display = 'none';
KRIS NIKOLAISEN
54,972 PointsKRIS NIKOLAISEN
54,972 PointsCan you post a snapshot? Click the camera icon in the upper right corner, then 'Take Snapshot', then post the link created here. If not can you post the code? Also it seems like you are talking about example2.html as that is the file with the button.