Timeline for How to make JavaScript execute after page load?
Current License: CC BY-SA 3.0
8 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Apr 10, 2020 at 0:47 | comment | added | Ray Foss | Reminder: Don't modify objects that aren't yours, specially globals... see Renan's link | |
Nov 26, 2017 at 5:25 | comment | added | Renan | Good solution, but now outdated: developer.mozilla.org/en-US/docs/Web/API/EventTarget/… | |
Jun 9, 2017 at 22:15 | comment | added | chaos | @ClayNichols: Correct. | |
Jun 9, 2017 at 4:47 | comment | added | Clay Nichols | So this will add this Function as an ADDITIONAL function to run OnLoad, correct? (rather than replacing an existing onload event) | |
Oct 8, 2015 at 13:45 | history | edited | chaos | CC BY-SA 3.0 |
improve by passing event through
|
May 4, 2009 at 20:00 | comment | added | Grant Wagner | I just discovered in testing that the code as written results in handlers being fired in an undefined order when attached with attachEvent(). If order-of-handler-execution is important you may want to leave out the window.attachEvent branch. | |
Apr 30, 2009 at 21:07 | comment | added | Grant Wagner | +1 for posting almost exactly what I had to come up with 6 months ago. Code like this can be necessary if other frameworks and code that you have no control over are adding onload events and you want to as well without wiping out the other onload events. I included my implementation as a function and it required var newonload = function(evt) { curronload(evt); newOnload(evt); } because for some reason the framework I am using requires an event to be passed to the onload event. | |
Apr 30, 2009 at 16:59 | history | answered | chaos | CC BY-SA 2.5 |