how to detect who is calling the function js code example
Example: Javascript get caller function
function alertTheCallersName(){
var callingFunctionName=alertTheCallersName.caller.name; //get the callers name here
alert(callingFunctionName);
}
function someOtherFunction(){
alertTheCallersName();
}
someOtherFunction();