Saturday 20 July 2019

JavaScript: How to find out which functions are called on event?




I have a problem, there is a website with a load of JS code. When I click on a certain element, some functions are called. How can I find out which functions (and in which files)?




For example, there's something like this



$( document ).ready(function() {
$("a").on('click', function() { $('c').css('opacity', '0.8'); });
$("ul#main li a").on('click', function() { $('c').toggle('.menu'); });
$("nav a").on('click', function() { callSomeFunctions(); });
});


And then I've got a menu like this







How can I find out that those 3 lines above are executed?



Thanks!


Answer



I always use this tool to see what events are linked to DOM elements http://www.sprymedia.co.uk/article/visual+event


No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...