I want to perform some task in jQuery when some other function in my JavaScript is called.
To explain the question: Let's say I have function foo(){..}
in JavaScript.
While my code is under execution phase, I want to perform some action using jQuery whenever function foo(){..}
is called.
Rough Demo:
<!DOCTYPE html>
<title>Demo</title>
<body>
<script>
function foo()
{
alert("Function Called");
}
...Some code....
if(some condition)
foo(); //function Call - I want to execute jQuery event when this line is executed.
else
woo();
</script>
</body>
</html>
Is there any event handler which can achieve this?