Check javascript/jquery function exists
if (typeof abc != 'undefined' && $.isFunction(abc)) { alert('abc exists'); } else { alert('abc does not exist'); }