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 JavaScript Basics (Retired) Introducing JavaScript Link to an External Script

Marino Carranza
PLUS
Marino Carranza
Courses Plus Student 851 Points

why is task number 1 no longer passing?

I have gone back a couple times and rewrote the code but it still not passing, what am I doing wrong?

index.html
<!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>
  <script>
    alert("I DID IT");
  </script>

</body>
</html>
shout.js

4 Answers

Marino Carranza
PLUS
Marino Carranza
Courses Plus Student 851 Points

Thanks very much, I got it! I was not looking the whole picture

Steven Parker
Steven Parker
231,275 Points

The task 2 code should all be in shout.js (the other tab).

Instead of adding another set of script tags along with the script code to the HTML, you should place only the script code in the other file.

The line you added in task 1 will cause the other file to be loaded.

Maybe you need to remove the second script tags, the one with the alert on it.

Hi,

You need to add the alert inside the shout.js file. You are loading the shout.js file into the html via the

<script src='shout.js' type='text/javascript'></script>

This tells the index.html file to go look inside the shout.js file to execute any javascript. So anything that is inside the shout.js file will be loaded when the interpreter sees the above script tag So inside shout.js go

alert('I DID IT');

Also note: this will greatly help in keeping your code organized.