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

alert within filename?

the alert warning is called within the file name

index.html
<!DOCTYPE HTML>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>JavaScript Basics</title>
<body>
<script src="shout.js"
<script> alert ("I DID IT!"); </script>.


</html
shout.js

4 Answers

Task 2 asks: Inside the shout.js file, write the code for an alert. You don't need to modify what you did in task 1.

I did Kris. that's why I don't understand why it won't work. it's saying it has to have opening and closing script tags. I tried that too and it's not working

Otec Perez Glass
Otec Perez Glass
7,678 Points

Kim Dallas Hi there! I hope you’re doing well. when you are calling the SRC attribute and you assigned a path in your case you do not have to write code inside the <script > tag all of your JavaScript code should be place on the shout.js file like this.

<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <title></title>
  </head>
  <body>

  <script src="shout.js"> </script>
    </div>
  </body>
</html> // Also remember to close the </html> 

and then the Js file or shout.js file

alert ("You Did It!");

thank you Otec

its not working