Sometimes, we want to fix JavaScript event window.onload not triggered.
In this article, we’ll look at how to fix JavaScript event window.onload not triggered.
How to fix JavaScript event window.onload not triggered?
To fix JavaScript event window.onload not triggered, we can use window.addEventListener
.
For instance, we write
window.addEventListener("load", yourFunction);
to add yourFunction
as the window load
event listener into our page.
Conclusion
To fix JavaScript event window.onload not triggered, we can use window.addEventListener
.