Check if a Javascript Function Exists Before Calling it

Sometimes for a reason or another, you may need to make sure a Javascript function exists or is accessible from your code, before calling it. That can be done through the following code:

[code]if (typeof yourFunctionName == ‘function’) { yourFunctionName(); }[/code]