jQuery code snippet to check whether a function exists within the JavaScript code. This can be easily achieved by using the jQuery.isFunction() function. Useful for checking if a jQuery function exists before calling it!

Note: As of jQuery 1.3, functions provided by the browser like alert() and DOM element methods like getAttribute() are not guaranteed to be detected as functions in browsers such as Internet Explorer.

Further reading: http://api.jquery.com/jQuery.isFunction/

Tags: jquery check function, jQuery check is function example, jquery function exists, jquery function exists example, jQuery.isFunction example, jQuery.isFunction()
Sam Deering is a Front-end Web Developer who specialises in JavaScript & jQuery. Sam is driven and passionate about sharing his knowledge to educate others.

No Reader comments

Learn Coding Online
Learn Web Development

Start learning web development and design for free with SitePoint Premium!