There is a third-party script that hangs a body.onload handler. I, in turn, need to use the same event, how to hang up the handler without wiping the old one?

  • one
    body.addEventListener("load", [your script]); - Igor
  • one
    @Igor decorate your comment as an answer - Alexandr Tovmach 1:31 pm

1 answer 1

Use addEventListener , allowing you to attach more than one handler to the event.

 body.addEventListener("load", function() { [your first script] }); ... body.addEventListener("load", function() { [your second script] });