Checking to see if a JavaScript function exists

To avoid JS clashes or the script falling over do this:

if(typeof yourFunctionName == 'function') {
// Safe to do something (if jquery search for $.yourFunctionName)
}

Tags: , ,

About Keiron

Web Developer based in the UK. Click here if you want to work with me