javascript checking for function and giving output if it exists -
I need a script which checks that the function is on the page and, if it is, this function calls And if not, it calls a different function
This is what I thought:
if (example function) diffunction (); And other works ();
You have to be careful to check the names not defined in Javascript. Referring to a name that is not defined will cause an error:
& gt; If (examplefunction) console.log ('exist'); Else console.log ('???') ReferenceError: Examination Function is not defined
If (example, example! = 'Undefined' and & amp; amp;; example function) diffunction (); Any other work ();
Comments
Post a Comment