简体   繁体   中英

Locate the javascript source code from a function using CHrome

Goal:
Retrieve the javascript of the function that you can zoom in and zoom out from this webpage .

Problem:
I can't find the source code. Where can I find it by using chrome.

Thank you!

You can monitor the event listeners on DOM elements using the Elements tab of the Chrome DevTools; see this documentation .

Simply select your element of interest (say, an image) in the DOM tree, and display its event listeners. You can then narrow them down to click , mousedown , mouseup or whatever. Expand these events, and you'll see the JavaScript files that attached listeners on them. You may find what you seek there.

Before we part ways: if the JavaScript code is minified (a huge one-liner, unreadable file), don't forget that Chrome can pretty print it (to a certain degree) by clicking on the {} just on the bottom-left corner of the code panel.

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