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 trialAbel Palomo Jr
172 PointsBrowsers may have been updated...
I do not know what the normalizing jargon was about, however, this question is more so a display issue. I have tried on all the different browsers and the same issue persists. When I load up this program, it seems to ignore the original html and goes straight to displaying the javascript program. I was assuming that because, per the "syntax hierarchy", I placed the <script> tag before the ending of the <body> (right before the closing tag) that it would display the content of the page first and then run the program. This won't work. Please help. What am I doing wrong or has something gone out of date that quickly?
Signed, An Eager Student
2 Answers
Steven Parker
231,269 PointsIt sounds like your placement of script tags is correct, but no matter where you place them, the browser should run the code and not display it. How do you reference the page to get it into the browser?
Are you using a workspace? If so, you can make a snapshot of your workspace and post the link to it here.
Anastasija Michailovskaja
1,304 PointsI'm having the same problem as described above on the Safari browser. Here's a link to my workspace: https://w.trhou.se/bo0fku0huj.
Steven Parker
231,269 PointsThis works fine when I open the preview. I see only the page and the alert boxes.
Amir F
9,095 PointsSame issue for me on Safari Version 13.0.5. The script file (preceding the closing body tag) runs before the initial HTML/CSS is rendered.
Works as expected in Chrome however. I'm guessing this is due to differences in JavaScript engines.
Daniela Fernandes Smith
Courses Plus Student 10,353 PointsDaniela Fernandes Smith
Courses Plus Student 10,353 PointsI think what they mean is that, when the browser first shows the page, instead of showing the h1 with the text "Welcome to JavaScript" or whatever is on the page beforehand, it shows the alert messages. In my case the same is happening, and I'm using the latest version of Chrome, and the script tag is also placed right before the closing body tag.