gpt4 book ai didi

ruby-on-rails - rails UJS : Preventing the event from propagating using 'ajax:before'

转载 作者:行者123 更新时间:2023-12-01 02:25:30 25 4
gpt4 key购买 nike

我对使用 rails/jquery-ujs.ajax:before 的工作方式感到困惑

  1. 它是否等待 ajax:before 中的任何给定函数完成后再继续?

  2. 如果 jQuery 中的事件未满足某些条件,如何完全取消该事件? (我似乎没有指向该事件的指针)

--

更新:我尝试过这个,通常可以工作,但现在不行。 =|

.bind('ajax:before', function(evt){
evt.stopImmediatePropagation();
} )
//also tried preventDefault, stopPropagation, etc

最佳答案

我回答了我自己的问题。 ajax:before 中的“return false”将取消操作

关于ruby-on-rails - rails UJS : Preventing the event from propagating using 'ajax:before' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4366777/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com