0

I know there is this repository for binding an event handler as first to be executed. I would like to achieve the same with pure JavaScript, but I read here that it ain't possible to check for the event-listeners being attached to an element. If so, is there another way to do this (preferably cross-browser down to IE9)?

My usecase for this is to execute a event-handler before another one which I can't control as it is added by a JavaScript-framework. There might be better work-arounds for my specific case, but I would like to know, if there is a general solution to this problem.

hugo der hungrige
  • 12,382
  • 9
  • 57
  • 84

1 Answers1

0

I think, setTimeout(...,0) does the trick. There is also important if event is sync or async. This article could be helpful.

bigless
  • 2,849
  • 19
  • 31