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

Load external script. I keep getting a syntax error, i don't know why. "shout.js" is the external file

I keep getting syntax errors , and i don't know why

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

6 Answers

I did . Thanks Anderson. Is working now

Thanks Andersson, is working now

Liam Andersson
Liam Andersson
1,396 Points

Shouldn't it be a "=" between the src and the shout.js?

Liam Andersson
Liam Andersson
1,396 Points

and the shout.js in ""

I don't know anything about JS so I'm not surprised if I'm wrong

Sargon Gabriel
Sargon Gabriel
2,618 Points

type in <script src="shout.js"></script> i think that should work

src means Source so wheneve you open a new "src" it needs a "=" followed by quotation marks ("")

Sargon Gabriel
Sargon Gabriel
2,618 Points

in your code there doesnt seem to be a = sign nor " " after the src ? can you explain to me more ?

Liam Andersson
Liam Andersson
1,396 Points

I didn't write the <script> code though I wrote that it should be = between the src and the shout.js and that shout.js should be surrounded with "", I guess you didn't read it?

Liam Andersson
Liam Andersson
1,396 Points

In words, I described the script: <script src="shout.js"> </script>

Thanks Gabriel, that worked. I typed it as above

Sargon Gabriel
Sargon Gabriel
2,618 Points

Liam make sure on the left bar of the workspace that your shout.js is located outside with the index file. if not you need to add a "(input the file name your shout.js is and then add this forward slash and then type in /shout.js"

Sargon Gabriel
Sargon Gabriel
2,618 Points

its like src="filename/shout.js"

Liam Andersson
Liam Andersson
1,396 Points

I know, But in this case there wasnt a need for that.. I know HTML But not JS. I didnt mean to be rude, I just thought that you didnt give me any credit for Being the First man to the rescue. Thats why i wrote ”As i stated above”. Im sorry if I made you mad. I apologize