如何使用Firefox调试器调试jQuery事件?

编程入门 行业动态 更新时间:2024-10-28 20:31:25
本文介绍了如何使用Firefox调试器调试jQuery事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我是为了讨论这个问题而建立的一个测试页面:

功能即将到来在Firefox 34中,所以如果你使用Firefox beta,它应该有你想要的行为。

I've been wracking my brain over this and cannot figure it out for the life of me.

Here's a test page I built for the sake of this discussion:

jsbin/garokalocu

Let's assume this page is very complex and I didn't build it, and I'm trying to see the code that runs when the user clicks "Do It." So I open the debugger, open the side pane and click "Events." I checkmark the click event for #execute which is the button.

Now I click the button, and the code hits the breakpoint. But strangely, the name "Bob" has already been filled in, so clearly it flew right past the actual code, and lands me here:

I don't understand what's going on here. So I tried something else, a new feature in Firefox that I thought might be handy. If I inspect the code, there are little "ev" tags on certain DOM elements. Supposedly you can click those and see the code.

Well, that was fruitless. I'd be forever grateful if someone could please tell me how on earth to debug jQuery events, and see the actual code that gets executed. Thanks!

解决方案

You see jQuery as the handler because you used jQuery to make those listeners. jQuery code is called when event is triggered. If you used normal JS addEventListener, they will show up in the event without having to step through.

According to the article here the feature is coming in Firefox 34, so if you use Firefox beta it should have the behavior you want.

更多推荐

如何使用Firefox调试器调试jQuery事件?

本文发布于:2023-11-09 05:09:43,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1571465.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何使用   事件   调试器   Firefox   jQuery

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!