开发者

Rails UJS: Preventing the event from propagating using 'ajax:before'

I am confused by how ajax:before works when using rails/jquery-ujs.

  1. Does it wait for any given function in the ajax:before to complete before proceeding?

  2. 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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜