问题描述
我有一个错误,可以防止在文本选择后滚动,而我不知道哪个事件或动作会产生错误。我真的想看看当我移动鼠标时触发了哪些事件。
重新连接源代码太多了,我希望有一个像嗅探器的东西,显示我触发的所有事件。
Borkdude说:
我一直在多次对事件处理进行黑客攻击,在我看来,尽管经典的步进调试器对跟踪长代码运行非常有用,它们跟踪事件并不好。想象一下,在每一个事件上都会听到鼠标移动事件并突破另一个应用程序...所以在这种情况下,我强烈建议您进行日志记录。
还有一个的Internet Explorer。我没有机会使用它,但它存在。 :-)它的缺点是它不是一个完全成熟的调试器,但它有一个window.console对象,这正是您需要的。
Is there a way to debug or trace every JavaScript event in Internet Explorer 7?
I have a bug that prevents scrolling after text-selecting, and I have no idea which event or action creates the bug. I really want to see which events are being triggered when I move the mouse for example.
It's too much work to rewire the source and I kind of hoped there was something like a sniffer which shows me all the events that are triggered.
Borkdude said:
I've been hacking around event handling multiple times, and in my opinion, although classical stepping debuggers are useful to track long code runs, they're not good in tracking events. Imagine listening to mouse move events and breaking into another application on each event... So in this case, I'd strongly advise logging.
And there's also Firebug Lite for Internet Explorer. I didn't have a chance to use it, but it exists. :-) The downside of it is that it doesn't a fully-fledged debugger, but it has a window.console object, which is exactly what you need.
这篇关于如何追踪像onclick onblur这样的JavaScript事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!