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

I get two errors - uncaught syntax and failed to load resource 404.

The code I used is below - I did have another workspace that I deleted because I wasn't getting ANY errors at first. When I started over I got two errors. How can I fix and get one error? Thanks in advance.

alert("Hello World");
console.log("Hello from the console.";
alert("Thanks for visiting.");
document.rite("<h1> Welcome to my webpage. </h1>");

1 Answer

Steven Parker
Steven Parker
231,275 Points

The 2nd line is missing a closing parenthesis between the last quote mark and the semicolon.

The last line has "write" misspelled (missing the "w").

This is the challenge where the code was supposed to be wrong to produce an error. When I wrote it, it produced the error and the failed to load resource error. I'm wondering why I got the second error.

Steven Parker
Steven Parker
231,275 Points

You forgot to provide a link to the challenge, but if you do, I'll try it myself and see what's up.

For future reference, take a look at this video about Posting a Question.