Is there an easy way to find out which jQuery script line is called an event?

I am working on a drupal module (irrelevant) and I would like to recreate the javascript / jQuery event. If I use chrome and go to event listeners, I can see that the jQuery script is being called on line 57, however this really doesn't help:

  • the script is mini and unreadable
  • I would like to know which jQuery string, using scripts called an event (which selector and what is the body of its function), and not the jQuery script itself
  • It is not easy to find a file, just search for suitable selectors, as there are 100 downloaded javascripts files thanks to drupal and installed modules.

The reason is that I would like to recreate this (possibly ajax) call: enter image description here

Does anyone know a trick like a chrome plugin or something like that? It can shave me a lot of time.

+5
source share
2 answers

If you set the correct breakpoint, you should get a Call Stack on the Source tab on the right side. There you can track the file that initiated the call.

And, as they say, the picture says a thousand words.

Jquery track file call.

And to further clarify your question,

It is always recommended to use uncompressed jQuery.js (or, in any case, any .js) during development, as you may already understand.

Steps for someone new.

  • Inside the compressed file, just get the no version.
  • Download the corresponding uncompressed version of jquery from the official site
+6
source

Try chrome devtools, for example:

 Sources -> Event Listener Breakpoints (to the right) -> Mouse -> click 
0
source

Source: https://habr.com/ru/post/1233718/


All Articles