Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

overrides window.onload event handlers attached using jQuery or window.addEventListener #619

Open
jrevillini opened this issue Aug 31, 2021 · 0 comments

Comments

@jrevillini
Copy link

The code as written now assumes that either

  • window.onload is set explicitly, or
  • window.onload is undefined

But if someone used jQuery to add a handler i.e.
jQuery( function( $ ) { $( window ).load( function () { ... } ); } );

or they used vanilla JS i.e.
window.addEventListener( 'load', function () { ... } );

then it's going to overwrite those handlers and they'll never run.

For more info about how to attach event handlers/listeners, see https://stackoverflow.com/a/30915025/8524018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant