Tuesday, September 11, 2018

jQuery: check if function exists

Just do:

if ( typeof function_name == 'function' ) { 
        //function_name is a function
}
else
{
 //do not exist
}

No comments:

Post a Comment