How can i listen to a specific function call with parametters using javascript:
example : when showname(2) is called i can do something like call another function to
One way to do it is to add a callback to the function, for example define:
function showname(firstname, lastname, callback){ alert(firstname + lastname); if(callback) callback(); } function showage(){ alert("who's age?"); }
And call:
showname("John", "Doe", showage);