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

Got stuck and getting mad

There are two files: a web page, index.html, and a JavaScript file, shout.js. To run any programming in the shout.js file, you first need to load it into the index.html file. Add the required HTML to load the external JavaScript file into the web page. Make sure to add your code inside the <body> of the page.

Need help with this question on the challenge.

index.html
<!DOCTYPE HTML>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>JavaScript Basics</title>
</head>
<body>
alert("heres another message from treehouse");
</body>
</html>
shout.js
<script src="scripts.js"></script>

5 Answers

Rich Donnellan
MOD
Rich Donnellan
Treehouse Moderator 27,708 Points

Take a deep breath ...

Ready?

You mixed up the placement of each snippet. <script> tags will always reside in your .html (markup) files. The logic will go into the actual .js file.

still don't get what i should do

Rich Donnellan
MOD
Rich Donnellan
Treehouse Moderator 27,708 Points

Rewatch the video. I can't explain further without just giving you the answer. What's the point in that?

Hey man, i got it after like a billion tries! I love coding!!! Its all about learning and always helping each other.

<script src="shout.js"></script>

Rich Donnellan
Rich Donnellan
Treehouse Moderator 27,708 Points

Two things:

  1. Format your code. Check out the Markdown Cheatsheet link below the "Add an Answer" for syntax examples.
  2. Posting an answer without explanation is frowned upon by the Community. Not to mention, there is more going on than what you posted.