javascript - Chrome and JS onclick function? - Stack Overflow

I wanted to test chrome to see if it can show me what method will be running for onclick registered eve

I wanted to test chrome to see if it can show me what method will be running for onclick registered event.

So I wanted to see which JS function execute shen people upvotes a question :

.jpg

But I couldn't found the actual code.

is it possible with chrome to find which JS executes when "onclick"?

edit

I could use the console to do it with :

$.each($(".vote-up-off").data("events"), function(i, e) {  // this will work till jq 1.8
  console.log(this)
});

and here is our friend:

But hey ! , I want chrome to do the work :-)

I wanted to test chrome to see if it can show me what method will be running for onclick registered event.

So I wanted to see which JS function execute shen people upvotes a question :

https://i.sstatic/3mbce.jpg

But I couldn't found the actual code.

is it possible with chrome to find which JS executes when "onclick"?

edit

I could use the console to do it with :

$.each($(".vote-up-off").data("events"), function(i, e) {  // this will work till jq 1.8
  console.log(this)
});

and here is our friend:

But hey ! , I want chrome to do the work :-)

Share Improve this question edited Jun 20, 2020 at 9:12 CommunityBot 11 silver badge asked Feb 16, 2013 at 12:32 Royi NamirRoyi Namir 149k144 gold badges494 silver badges831 bronze badges 1
  • Have you tried using Chrome's JavaScript CPU profiler? – hohner Commented Feb 16, 2013 at 12:37
Add a ment  | 

2 Answers 2

Reset to default 3

One potential insight might be to enter this in your console and press return:

$('.vote a').data('events').click;

jQuery stores all of its events which are bound to an object inside of the data() object; so if you want to view a particular event binding, this is your place to look. Console will return an object. Expand handler --> <function scope> --> Closure and you can now see all of the associated JavaScript around this click event.

some workarounds available U may try this bookmarklet concept Visual Event

Add bookmarklet to you browser bookmarks(enable bookmarks bar show always) and click on bookmark while on the page u want to debug

PS: it is for Jquery

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745451389a4628287.html

相关推荐

  • javascript - Chrome and JS onclick function? - Stack Overflow

    I wanted to test chrome to see if it can show me what method will be running for onclick registered eve

    9小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信