Author Topic: Check if a Javascript Function Exists or Is Defined  (Read 5170 times)

Offline admin

  • Administrator
  • Sr. Member
  • *****
  • Posts: 296
    • View Profile
Check if a Javascript Function Exists or Is Defined
« on: March 25, 2010, 11:20:06 AM »
To check if a Javascript function exists before calling it, try this:

Code: [Select]
if(typeof yourFunctionName == 'function') {
yourFunctionName();
}