Search code examples

Check if Function Exists before Calling?

Possible Duplicate:
jQuery test for whether an object has a method?

I want to set if Function Exists before Calling javascript can you help me how do this and apply on this script

$(document).ready(function() {


  • I'm assuming that you're wanting to check and make sure that lettering exists, try this:

    As of jQuery 3.3, jQuery.isFunction() has been deprecated. In most cases, its use can be replaced by typeof x === "function".

    Here's an example:

    if ( $.isFunction($.fn.lettering) ) {

    For jQuery 3.3 and higher use:

    if  (typeof $.fn.lettering === "function" ) {