Skip to content
Advertisement

Tag: onload-event

alert called by onload event not running? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 2 years ago. Improve this question I’m creating a chrome extension, but I’m struggling with the Onload event. I’m not sure what’s wrong with my code. It works when I run

When to use “window.onload”?

In JavaScript, when I want to run a script once when the page has loaded, should I use window.onload or just write the script? For example, if I want to have a pop-up, should I write (directly inside the <script> tag): Or: Both appear to run just after the page is loaded. What is the the difference? Answer window.onload just

Advertisement