Based on a variable SomeCondition, I need to intercept a click event on a button, and ask for confirmation, if they say ok, proceed, otherwise ignore click.
SomeCondition
With jQuery to prevent default you just return false:
return false
$("#button1").click(function () { //do your thing return false; });