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

Leonardo Cavalcanti
Leonardo Cavalcanti
5,308 Points

Javascript error, basics

So this was supposed to be an easy task, just add shout.js to the HTML file, just like i did... It says i should make sure to add both <script> and </script> but apparently i had already done that, so i dont know what could possibly be the error.

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

index.html
<!DOCTYPE HTML>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>JavaScript Basics</title>
  <script src="shout.js></script>
</head>
<body>
</body>
</html>
shout.js
alert("HEY, YOU'RE LEARNING TO PROGRAM JAVASCRIPT!");

1 Answer

Travis Brim
Travis Brim
4,908 Points

Looks like just a missing quotation mark in your <script> tag.