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 trialKevin Solon
256 PointsI thought I followed steps correctly but the webpage didn't load in the correct order?
I placed <script src="scripts.js"></script> right before the end of the </body> and it loaded the 2 pop up messages before the webpage content. wondering what I did wrong or if I did it wrong.
4 Answers
Steven Parker
231,269 PointsPerhaps nothing is wrong.
It's not clear from your description, but perhaps the behavior you observed is correct for the program and browser. For a more detailed analysis, you would need to show the complete code and indicate what browser and version you are using.
Alexander Marciante
Courses Plus Student 206 PointsAny help appreciated. I just started the course and can't believe I'm already stuck :( . I'm using Chrome Version 56.0.2924.87 on Win10
Loki Thor
6,003 PointsI can't seem to emulate the same either. I would get two alerts and then it renders the page. Maybe modern browser just executes too fast that both alerts are called before the page renders? To be honest, it's not a big deal, but I do like the results in the video better: alert, renders HTML, alert.
Anna Kertesz
5,380 PointsHaving the same happen, on Chrome Version 58.0.3029.96 on MacBook Air.
My pop-up's look different too, but I assume that's because the browser has updated since the video was captured.
Below is the html used.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="css/main.css">
<title>JavaScript Basics</title>
<script>
alert("Here's another message from Treehouse");
</script>
</head>
<body>
<div class="container">
<h1>Where to place your JavaScript code.</h1>
</div>
<script src="scripts.js"></script>
</body>
</html>
Keegan Usher
26,226 PointsTry adding defer after the src, this might give you the results you are looking for. <script src="scripts.js" defer></scirpt>
Shuchan Chen
4,202 PointsShuchan Chen
4,202 PointsI have the same problem. The two messages come up before the html. In the video, after the first message, it would load html. Then, show the second message. But it doesn't follow this order in my webpage. I'm using chrome.