这是什么事件绑定是什么意思? [英] What does event binding mean?

查看:321
本文介绍了这是什么事件绑定是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是什么事件绑定是什么意思?我总是遇到这个词,每当我在互联网和任何我尝试寻找的意思搜索,它仍然模糊,我@ _ @
前一段时间,而对于阅读JavaScript的一些博客我看到使用这个神圣的字眼,我不能把握的人。

What does event binding mean? I always come across this word whenever I search around the internet and whatever I try to look for the meaning, it's still vague to me @_@ A while ago, while reading some blogs regarding JavaScript I see people using this sacred word that I cannot grasp.

推荐答案

事件绑定是指讲,每当一些事件发生特定的功能应该被称为浏览器。活动主要涉及到用户的输入,如点击次数。

Event binding refers to telling the browser that a particular function should be called whenever some 'event' occurs. Events mostly relate to user input, such as clicks.

结合jQuery中的事件的例子可以是以下

An example of binding to an event in jQuery can be the following:

$("#elem").bind("click", function() {
    alert("Clicked!");
});

此结合标识符为 ELEM DOM对象的点击事件的函数。当用户点击它,一个警报(消息框)将被显示。绑定是通过调用jQuery的绑定函数来完成,但也有其他方式来做到这一点,(如jQuery的点击功能结合案例点击事件)。

This binds a function to click event of DOM object with identifier elem. When user clicks it, an alert (message box) will be shown. Binding is done by invoking the jQuery bind function but there are other means to do that, (e.g. jQuery click function in case of binding to click event).

这篇关于这是什么事件绑定是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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