How to stop page from refreshing after confirmation box?

I have this code inside a a method that forms a menu in Ext:

  handler: function() {
     var r = $wnd.confirm("Are you sure?");
  }

When I use $wnd.alert, it just shows a popup. When replaced with confirm, it works but then causes the whole page to refresh after a selection. Ideally, I'd like to use $wnd.Ext.MessageBox.confirm, but when I use that, I get the error cb.defer is not a function. Figuring out how to get the javascript confirm to work will be much appreciated.

Answers


I would suggest one (or a combination) of these options:

event.cancelBubble = true;
event.stopPropagation();
return false;

Need Your Help

Common APIs to launch EC2 and Openstack instances

amazon-ec2 openstack-nova

At work we use Amazon linux Ec2 instances for production purposes. Also, for our internal dev setup we use openstack Cent OS instances.

Material Design Lite layout has changed after installing Iron:router

meteor iron-router material-design-lite

I created a meteor project and added krazyeom:material-design-lite package. Then I created 2 simple html files, one that contains