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 trialTyler Cole
387 PointsI'm confused... It says I have to many script tags.
Why does it say I have to many script tags?
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JavaScript Basics</title>
<script>
alert("I DID IT!!! I think...");
</script>
</head>
<body>
<div class="container">
<h1>Hello Person.</h1>
</div>
<script src="shout.js"></script>
</body>
</html>
Steven Parker
231,269 PointsThe script code goes in the shout.js file. At the top of the editor (the black area) there are tabs representing the files. Click on the name "shout.js" to select that file.
2 Answers
Steven Parker
231,269 PointsGabriel's right about putting the alert
call in the other file (shout.js). But the error message is pointing out that you have a set of script
tags in the head
area as well as one in the body
of your HTML. The second one is correct, and the first one should be removed entirely.
Also, be sure to use the exact string given in the instructions (just one exclamation, no extra words).
Gabriel Santos
4,113 PointsYou have to place the alert function inside the shout.js script
Once you refresh, it will automatically run the script since you have the shout.js linked at the bottom of your page.
Tyler Cole
387 PointsTyler Cole
387 PointsI am still confused... so where would I put it?