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

There are two files: a web page, index.html, and a JavaScript file, shout.js. To run any programming in the shout.js fil

task 1 of 2

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".alert"hello noel");</script> 
</body>
</html>
shout.js

you just need to link shout.js <script src="shout.js"></script> and then write alert('I did it '); in the file that you have shout.js not in the same line with the script tags :)

1 Answer

Check your opening script tag. The src is an attribute of the script tag itself.

So when your trying to link an external javascript file the skeleton of the link would look like this:

<script #your attributes src, type, etc#></script> or <script src=""></script>

Can you please just try the way that I told you :)

Because i just try linking the script tag as i write you and that's the right way :)