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 trialDonald Richmond
13,807 PointsHELP! 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>
6 Answers
Allison Davis
12,698 PointsHi 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.
Donald Richmond
13,807 PointsAllison, 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>
Donald Richmond
13,807 Points<body> <div class="container"> <h1>The Story Maker Program</h1> <script type="text/javascript" src="story.js" > </script> </div> </body>
Allison Davis
12,698 PointsAh, I see. Try src="../story.js" since they're in the same folder.
Donald Richmond
13,807 PointsDid not help!
Donald Richmond
13,807 PointsSorry! Must leave now!
Marcus Parsons
15,719 PointsMarcus Parsons
15,719 PointsHi 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