JavaScript JavaScript Basics 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

  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
   <title>JavaScript Basics</title>
    <script>src=("shout.js".alert"hello noel");</script> 

Goce Petrov
Goce Petrov
7,103 Points

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

Andrew Hinkson
Andrew Hinkson
12,593 Points

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>

Goce Petrov
Goce Petrov
7,103 Points

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 :)