Check if a function Exists using javascript





7
Date Submitted Fri. Aug. 4th, 2006 10:01 AM
Revision 1 of 1
Syntax Master sundaramkumar
Tags JavaScript
Comments 0 comments
check if a function exists in your code using javascript before calling it.


if ( window.functionName )
{
   functionName()
}
else
{
    alert( 'function not found' )
}

 

Comments

There are currently no comments for this snippet.

Voting