I encountered a small issue on javascript while doing a small hack for a VBulletin plugin. Sometimes a javascript function was included, sometimes not.
So I needed a way to check if that function was or wasn’t defined so I can call it safely (without any error message). In case you ever need something like this .. here is the code 🙂
if(typeof functionNameToCheck == 'function') {
//you can now safely call your function
}
Cool, Your rock. 🙂 Nice trick.
Thank you very much. It helped lot.:)