JavaScript JavaScript Basics (Retired) Introducing JavaScript Where Does JavaScript Go?

Agnieszka Niemiec
Agnieszka Niemiec
6,528 Points

Order of actions

I put the second statement before the closing </body> tag but the browser didn't display the content before executing the second command. Can someone tell me why and should I be bothered by that? I'm using Google Chrome.

1 Answer

Steven Parker
Steven Parker
182,590 Points

It's not clear what "second statement" you are referring to, but it's normal for a browser to perform any JavaScript before the page is rendered and displayed.

Some videos (perhaps including this one) were made before this was standard browser behavior, so keep that in mind.