jQuery-确保事件处理程序最后在处理程序链中执行 [英] Jquery - Make sure event handler is last to be executed in chain of handlers

查看:79
本文介绍了jQuery-确保事件处理程序最后在处理程序链中执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有办法确保您附加的事件处理程序是要执行的事件处理程序链中的最后一个?

Is there a way to make sure the event handler you attach is the last in the chain of event handlers to be executed?

我有一个事件处理程序,可以通过ajax提交表单,但是稍后,在附加我的ajax提交处理程序之后,另一个处理程序将附加到表单上以执行验证逻辑.验证逻辑应该在ajax提交处理程序之前发生,但是由于它是在绑定之后才发生的.

I have an event handler that submits a form by ajax, but at a later time, after I attach my ajax submitting handler, another handler is attached to the form to do validation logic. The validation logic should occur before the ajax submitting handler, but it doesn't since it was bound afterwards.

有没有办法使我的ajax提交处理程序始终是要执行的处理程序链中的最后一个处理程序,而无需更改处理程序的绑定顺序?

Is there a way to make it so my ajax submitting handler always is the last handler in the chain of handlers to be executed, without changing the order in which the handlers are bound?

推荐答案

我认为没有办法直接处理订单.

I don't think there is a way to manipulate the order directly.

看看这个:如何订购与jQuery绑定的事件

这篇关于jQuery-确保事件处理程序最后在处理程序链中执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆