On Fri, Dec 9, 2011 at 1:53 AM, Geoffrey Knutzen <[email protected]> wrote: > If a script is included on an html page with the deferred attribute, and the > script attaches a handler to the window.onload event, and the onload event > fires, will that handler ALWAYS be executed?
Depends on actual execution of the script. If the script is executed before window.onload is fired but after everything else then yes, your callback will fire. If deferred causes your script to run some time after window.onload to fire then no, your callback doesn't fire. At this time I'm not sure whether deferred guarantees either but I'm sure you can easily search for that. The point is that the onload only fires once. If your script was executed before that, your callback will be executed, else it wont. - peter -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/[email protected]/ To search via a non-Google archive, visit here: http://www.mail-archive.com/[email protected]/ To unsubscribe from this group, send email to [email protected]
