简体   繁体   中英

How can I find out which functions are being called?

I'm using mmenu jQuery plugin which makes the page slide to the left and displays a menu on the right when a user clicks a menu icon. To make the main page slide back the user has to click the main page on the left.

Using Chromes Developer Tools how can I find out which functions are being called so I can know which function is responsible for sliding the main page back to its original position?

when you click on particular element in chrome dev tools, in the right side partition (left partition should show your DOM) you will find styles, computed, Event Listeners. So if you visit event listeners tab it will show all types of events associated for any particular element typically with it's callback function in a single line.

This is one of the way i know, its bad but it works. To filter the files, you can click the file names in the profile, it will take you to the function.

这是我知道它不好但有效的一种方式。

您可以做的是使用以下命令使每个函数输出自己的名称

console.log("function name");

尝试将断点放置在代码中可以执行此操作的任何位置。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM