I created a jquery function, but $.isFunction seems to always return false if the function name is inside a string.
(function( $ ) {
$.myTest = function() {
return true;
}
})( jQuery );
alert($.isFunction('$.myTest'));
Fiddle : here.
Note : if I remove quotes (eg. alert($.isFunction($.myTest));, it works, but my function is inside a string.
EDIT
This function name is inside a string because I create a plugin to make ajax from parameters inside the dom elements. For example :
data-route="xxx.php"
data-lock=".buttonsToLock"
data-output="#outputContainer"
data-callback-after="$.myTest"
But I am unable to check if data-callback-after is an existing function.
Any idea?
Thanks
Looks like you trying to dynamically call functions / callbacks.
You should consider the following approach.