Test if a javascript function has been defined before calling it

Thursday 16th April, 2009 — Leave a comment
if (typeof yourFunctionName == 'function') 
{
    yourFunctionName();
} 

Gabe

Posts

No Comments

Be the first to start the conversation.

Leave a Reply

*

Text formatting is available via select HTML. <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>