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 trialChristopher Fitzgerald
176 PointsEvery time I try to check my answers on the second task it tells me that task 1 is no longer passing, why?
Please note that i have gone back to the first task several times and every time i click check answers again to see what is wrong it tells me I've done a good job and allows me to proceed once more to the second task.
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JavaScript Basics</title>
</head>
<body>
<script src="shout.js";></script>
</body>
</html>
<script>
alert("I DID IT!);</script>
3 Answers
Stuart Wright
41,120 PointsI'm not sure why you get that specific error message, but your code for part 2 is definitely wrong, for a couple of reasons:
- You shouldn't use <script> tags inside a .js file. These are for when you want to insert JavaScript directly into your HTML.
- You are missing a " at the end of your string. The correct code for your shout.js file is:
alert("I DID IT!");
Sipann A.
30,234 PointsWhy the semi-colon after src="script.js" in your index.html ? Also : there is a missing quote in your alert() in shout.js => alert("I DID IT!");
Matthew Lang
13,483 PointsYou are missing a speech mark.
<script>alert("I DID IT!");</script>
Christopher Fitzgerald
176 PointsChristopher Fitzgerald
176 PointsWhile I appreciate that insight I'm not sure if you've answered my question, are you saying that the "task one is no longer passing" message should be resolved if I input the code correctly? Edit: I corrected the errors in the code and everything worked great thanks for your help.