I am confused by how ajax:before
works when using rails/jquery-ujs.
Does it wait for any given function in the
ajax:before
to complete before proceeding?How do I completely cancel the event in jQuery if it fails some condition? (I do not seem to have a pointer to the event)
--
Update: I tried this, which normally works, but not now. =|
.bind('ajax:before', function(evt){
evt开发者_如何学运维.stopImmediatePropagation();
} )
//also tried preventDefault, stopPropagation, etc
I answered my own question. "return false" in the ajax:before will cancel the action
精彩评论