S
S
Sergey2012-01-25 15:10:43
JavaScript
Sergey, 2012-01-25 15:10:43

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

2 answer(s)
4
4dmonster, 2012-01-25
@4dmonster

Does UserJS not work after onload? Insert into your script alerts for checks.

4
4dmonster, 2012-01-25
@4dmonster

"UserJS on window via addEventListener"
If in firefox and GreasyMonky, it
comes to mind to try unsafeWindow

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question