Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript JavaScript Basics (Retired) Introducing JavaScript Link to an External Script

Gareth Partridge
Gareth Partridge
13,408 Points

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

There is something wrong with my Syntax, I am not sure what I am missing?

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>
</body>
</html>
shout.js

3 Answers

Antonio De Rose
Antonio De Rose
20,877 Points
<script> src="shout.js"></script>

open angle brackets, you have - 2.

closed angle brackets, you have - 3.

count should pair up, for open brackets against closed.

Gareth Partridge
Gareth Partridge
13,408 Points

Hi Antonio, Thanks for the reply.

Sorry but I have tried adding the brackets in a few places and it is still coming out wrong. I have even compared your code that you posted to mine and it is exactly the same. still coming up with errors.

Antonio De Rose
Antonio De Rose
20,877 Points

I haven't given you the direct answer, but I have only pasted your code, and explained below, is what you have done wrong.

Sorry, I cannot give direct answers, that will not help you.

If you have still issues, write to me.

Gareth Partridge
Gareth Partridge
13,408 Points

Thanks I understand,

perhaps you can help me with the next step? I need to add the message I did it, will the message share the <script> with the shout.js file or should I open a new <script> for the message?

<script src="shout.js" alert("I DID IT!");></script>

Antonio De Rose
Antonio De Rose
20,877 Points

neither would do.

read the question again carefully.

Inside the shout.js file, write the code for an alert dialog with the message 'I DID IT!'.

it says inside the shout.js file, and you have 2 tabs in the question.

one for the index file.

and another for the shout.js file.