JavaScript JavaScript Basics Introducing JavaScript Link to an External Script

Gareth Partridge
Gareth Partridge
9,688 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,856 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
9,688 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,856 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
9,688 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,856 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.