How to add JS Confirmation popup when clicking an #AJAX button in custom module?
I could have sworn it was on so somewhere. But I could not find it quickly. You can try this using the form API in your button. Found here

 '#attributes' =&gt; array('onclick' =&gt; 'if(!confirm("Really Delete?")){return false;}')


You can of course use JS as you were. I think you were missing the return false;