I have the following link on the page:
<a href="/go/some/where.htm">...</a>
It lives among HTML that makes up a google.maps.InfoWindow box (which itself doesn't have a click event). This infobox comes up when the user moves the mouse over a mapping pin. For whatever reason, when the user clicks on a link in the infobox, it doesn't fire and I am trying to find out why.
The code base is huge and I have no idea where exactly the preventDefault or propagation is stopped. Is there an easier way? Can I hook into the event flow some way that would show me what is preventing the click?
答案 0 :(得分:6)
除了Wyatt提到的JavaScript调试器之外,您还可以在Chrome Developer Tools中的任何DOM元素上查看事件监听器。右键单击元素&gt;检查:选择右侧的“事件监听器”选项卡。
答案 1 :(得分:2)
我之前遇到过类似的情况,你有几个选择。
preventDefault
或类似代码的所有文字,然后查看每个代码的内容答案 2 :(得分:1)