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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Ziya Jamalov](https://uploads.teamtreehouse.com/production/profile-photos/11700750/micro_IMG_0216.jpg)
Ziya Jamalov
3,490 PointsJS Loads Before HTML
Hi, everobody! An issue with the loading of JS code I didn't change anything in HTML file. JS code stays before </body> Despite it alert(""); loads before <h1> and sometimes before the page at all
1 Answer
![Steven Parker](https://uploads.teamtreehouse.com/production/profile-photos/969492/micro_tool_chess_set_2.jpg)
Steven Parker
230,688 PointsThe HTML code actually loads first, but the browser doesn't render it to the screen until the JavaScript program runs and finishes. So it's normal for any "alert" messages in the js code to show before the page does.
Ziya Jamalov
3,490 PointsZiya Jamalov
3,490 PointsHi, Steven, Thanks. Maybe There is any solution for such issue?
Steven Parker
230,688 PointsSteven Parker
230,688 PointsThis is normal operation, it doesn't require a "solution". When communicating from the program, you use "prompt" and "alert". When communicating through the web page, you use event handlers and DOM updates.
Techniques for using event handlers will be covered in later courses.