0

I have a page that has some td elements in a table that the user can click and drag to reorder. The page is built using prototype. In everything but IE9, this works, but in IE9, when I try to click and drag, I just highlight some of the things on the page. My suspicion is that the handler isn't actually attaching to the td element.

Is there a way to check what listeners are attached to an element in IE9?

(The code is also not in a place that I can share it, which is why I have not posted any.)

Edit: It turns out I was actually using prototype 1.6.1, and the problem was ultimately caused by that not knowing that IE9 and IE10 are less awful than < 9. It's going to be a much bigger fix than I thought.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
hoylemd
  • 436
  • 5
  • 15
  • console.log(myElem.onclick) ? And then just test as many event listeners as you can think of. – Jackson Jul 31 '13 at 17:03
  • There may also be a way to view the dom element object's properties in the web inspector (F12). Not sure where though. – Jackson Jul 31 '13 at 17:05
  • I can see the dom element's properties, U just don't know where to look. Any ideas? – hoylemd Jul 31 '13 at 17:06
  • http://stackoverflow.com/questions/446892/how-to-find-event-listeners-on-a-dom-node You may find your answer here. – Jackson Jul 31 '13 at 17:33

1 Answers1

0

The latest PrototypeJS (1.7.1) stores the event observers in an Event Cache

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

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

After you create an observer via the observe() or on() methods like this

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

The click property of the Event cache will be set like below

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

However this might not be the source of your problem as you said it is working in all other browsers except IE9 - is there a way you can extract some of the code and put it into a JSFiddle and then post the link?

Geek Num 88
  • 5,264
  • 2
  • 22
  • 35