35. Page Load Events and Other Stuff

In This Chapter

  • Learn about all the events that fire as your page is getting loaded

  • Understand what happens behind the scenes during a page load

  • Fiddle with the various script element attributes that control exactly when your code runs

An important part of working with JavaScript is ensuring that your code runs at the right time. Things aren’t always as simple as putting your code at the bottom of your page and expecting everything to work once your page has loaded. Yes, we are going to revisit some things we looked at in Chapter 10, “Where Should Your Code Live? Every now and then, you may have to add some extra code to ensure your code doesn’t run before the page is ready. Sometimes, you may ...

Get JavaScript Absolute Beginner's Guide, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.