[ad_1]
function sb_save(){
alert('saving');
}
$('button').on('click', function(){
if (typeof sb_save==="function"){
sb_save();
}
});<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<button>Click</button>2
[ad_2]
solved how to check if a function exists [duplicate]