简体   繁体   English

如何使事件监听器在javascript中执行最后

[英]how to make an event listener execute last in javascript

Two or more event listeners are listening to a radio button. 两个或多个事件侦听器正在侦听单选按钮。

How can i make one of them execute the last? 我怎样才能使其中一个执行最后一个?

 jQuery(document).on('change', '#payment_id_2', function(){
     location.reload();
 });

This the event listener that i want to be executed the last. 这是我想要最后执行的事件监听器。

I don't know where are the other event listeners to put them first. 我不知道其他事件监听器在哪里放置它们。

You can set a timeout but i think its a bad practise to let the browser wait like this. 您可以设置超时,但我认为让浏览器像这样等待是一种不好的做法。 Since this is in async though i dont think there is another way of doing it. 因为这是异步,虽然我不认为还有另一种方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM