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

HELP! Why does the browser not read in the javascript file? I have checked the link and the name of the file. ????

Here is the code to access the java file: What gives???

<body> <div class="container"> <h1>The Story Maker Program</h1> <script type="text/javascript" src="story.js" > </script> </div> </body>

Hi Donald,

I'm seeing a lot of confusion here. Can you please post a snapshot of your workspace for us to see? If you don't know how to do that, here's a handy dandy forum post for you! http://www.teamtreehouse.com/forum/workspace-snapshots

6 Answers

Allison Davis
Allison Davis
12,698 Points

Hi Donald, Is the story.js file in a js folder? If so, src attribute should look something like "js/story.js".

You might want the script tag linked either higher or lower on your HTML doc, but not seeing the rest of the code I can't say for sure.

Allison, It is not in a folder. It is on the same level as the index file. Here is the complete code.

<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <link rel="stylesheet" href="css/main.css"> <title>The Story Maker</title> </head> <body> <div class="container"> <h1>The Story Maker Program</h1> <script type="text/javascript" src="story.js" > </script> </div> </body> </html>

<body> <div class="container"> <h1>The Story Maker Program</h1> <script type="text/javascript" src="story.js" > </script> </div> </body>

Allison Davis
Allison Davis
12,698 Points

Ah, I see. Try src="../story.js" since they're in the same folder.

Did not help!

Sorry! Must leave now!