Answer the question
In order to leave comments, you need to log in
Reset events in JS
There is a ready-made internal system, it cannot be changed. There is a task to write userjs to interact with data. In UserJS, a load event handler is hung on the window via addEventListener (I also tried DOMContentLoaded). But, when the page is loaded, the call to the handler does not occur.
The system script is also initialized by onload and its call is registered in the onload attribute of the body tag. I checked and it shouldn't overlap. The script called there changes the DOM structure, loads the data, changes the page design. But in fact, this should not affect the work of my handler in any way.
Therefore, the question is, what are the possible reasons for refusing to call my handler? In the application code, I did not find anything directly related to clearing the event stack.
Answer the question
In order to leave comments, you need to log in
Does UserJS not work after onload? Insert into your script alerts for checks.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question