Check if a Javascript Function Exists or Is Defined
To check if a Javascript function exists before calling it, try this:
if(typeof yourFunctionName == 'function') {
yourFunctionName();
}
To check if a Javascript function exists before calling it, try this:
if(typeof yourFunctionName == 'function') {
yourFunctionName();
}