Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
由于 ujs 通过简单地包含 jquery ujs 源来分配事件处理程序,我如何覆盖特定调用的任何 $.ajax 设置?
如此多的示例使用全局方法。这只是首选方法吗?
(我问了一个较早的问题,我认为所有自定义都可以通过 data-* 属性获得。)
您可以通过以下方式绑定到特定元素的 AJAX 成功:
$element.bind("ajax:success", function(xhr, data, status){ doSomeStuff(); });