使用jquery将事件添加到事件堆栈顶部 [英] add event to top of event stack using jquery

查看:103
本文介绍了使用jquery将事件添加到事件堆栈顶部的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用jquery向文本框添加一个模糊事件。我希望我的活动在任何其他现有活动之前开火。这样做可以吗?

解决方案

做这样的事情:

  var fn = document.GetElementByID('x')。clicked; 
document.GetElementByID('x')。clicked = function(){
// action
fn();
}

在Javascript中,函数是函数指针。


I'm using jquery to add a blur event to a text box. I would like my event to fire before any other existing events. Is this possible to do?

解决方案

Do something like this:

var fn = document.GetElementByID('x').clicked;
document.GetElementByID('x').clicked = function(){ 
  //action
  fn();
}

In Javascript the functions are function pointers.

这篇关于使用jquery将事件添加到事件堆栈顶部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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