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 trialpamela guy
Courses Plus Student 4,311 PointsCan someone tell me why this is not working?
Why is this not working help please?
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JavaScript Basics</title>
</head>
<body>
<script>alert("I DID IT");</script>
</body>
</html>
alert( 'I DID IT!');
3 Answers
Joe Beltramo
Courses Plus Student 22,191 PointsYou need to add a way to load the shout.js
file into the index.html
file.
In order to do this you are going to want to add the html tag script
:
<script></script>
Next you will want to link the shout.js
file by adding the src attribute to the script
tag:
<script src="javascriptFileName.js"></script>
Hint: Replace javascriptFileName.js with shout.js
Justin Radcliffe
18,987 PointsHi Pamela,
You don't need to duplicate the alert() function in both files. Just keep the one in the .js file as you currently have it. Then you need to link to the shout.js file inside the index.html file as Joe Beltramo mentions above.
pamela guy
Courses Plus Student 4,311 Pointsthank you!
Mohammed Nokri
931 Pointscan fix it by using the <script> tag to include js file in your page, and delete other one in the body
<head> ... <script src="javascriptFileName.js"></script> ... </head>
Joe Beltramo
Courses Plus Student 22,191 PointsThe challenge specifically asks for the script
tag to be placed in the body. So unfortunately your solution would not pass the challenge requirements.
pamela guy
Courses Plus Student 4,311 Pointspamela guy
Courses Plus Student 4,311 Pointsthank you!