How to check Listeners event on an element in IE9

I have a page containing some td elements in a table that the user can click and drag to reorder. The page is built using a prototype. In everything except IE9, this works, but in IE9, when I try to click and drag, I just highlight some things on the page. I suspect that the handler is not actually attaching to the td element.

Is there a way to check which listeners are connected to an element in IE9?

(The code is also not in the place where I can share it, so I have not posted any.)

Change: It turns out that I actually used the prototype 1.6.1, and the problem was ultimately caused by not knowing that IE9 and IE10 are less terrible than <9. It will be much more than I thought.

0
source share
1 answer

The latest PrototypeJS (1.7.1) stores event observers in the event cache

So for example a <div>with id 'mydiv'

<div id="mydiv"></div>

After creating an observer using methods observe()or on()similar

$('mydiv').observe('click',function(){
    alert('Click Happened');
});

The click property of the event cache will be set as below

Event.cache[$('mydiv')._prototypeUID].click

However, this may not be the source of your problem, as you said that it works in all other browsers except IE9. Is there a way to extract a piece of code and put it in a JSFiddle and then post the link?

0
source

Source: https://habr.com/ru/post/1794808/


All Articles