w3ka dev - share the knowledge .NET
How to check if JavaScript function exists?
Checking if function exists differs from the regular object checking. In order to ensure a function exists you can use typeof operator for the verification.
if (typeof myFunctionName === 'function') {
myFunctionName();
}
Newer Posts
Older Posts
Home
Subscribe to:
Posts (Atom)