Ext.: http://www.cnblogs.com/aaronjs/p/3440647.html?winzoom=1Event is the heart of the JavaScript app beating, and by using JavaScript, you can listen for specific events and specify that certain events occur to respond to these eventsThe foundation of the event does not repeat the explanation, originally is the localization source code analysis realizes, therefore needs to have certain foundation to be OKIn order to better understand the internal imp
[Guide]The differences between BIND (), live (), and delegate () methods are not very obvious. Figuring out these differences is very helpful for writing the summary code and preventing the emergence of bugs in our applications. The jquery team released a new method calledThe differences between the BIND (),. Live (), and. Delegate () methods are not very obvious. Figuring out these differences is very help
convenient and simple to bind events to elements;·. Click (),. Hover () ... These very convenient event bindings are a simple way to handle bind;• For elements selected with ID, it is very good, not only to hook up quickly (because a page has only one ID), and when the event occurs, handler can be executed immediately (relative to the following live, delegate) i
The jquery team released a new method for binding events in version 1.7 called on. This method contains the features of live, bind, and delegate described below, allowing us to specify the way to bind events by passing different parameters rather than through different method names.
Basic knowledgeDefinitions and usage
The bind () method adds one or more event handlers for the selected element and sets th
DOM tree
First, it is helpful to visualize the DOM tree of an hmtl document. A simple HTML page looks like this:
Event bubbling (also known as event Propagation)
When we click a link, it triggers the Click Event of the link element. This event triggers the execution of any function on the click
JQuery event binding usage (with the difference between bind and live), jquerybind
This document describes how to bind jQuery events. We will share this with you for your reference. The details are as follows:
Html:
Javascript:
Notes:
Bind (type, [data], fn) binds an event handler function to a specific event of each
The example of this article analyzes the jquery event binding usage. Share to everyone for your reference, specific as follows:
Html:
Javascript:
Some notes:
Bind (TYPE,[DATA],FN) Bind event handlers for specific events for each matching element
Copy Code code as follows:
$ ("a"). Bind ("click", Function () {alert ("OK");});
1. Bind ()Description: Binds an event handler for an element.. Bind () A basic usage:$ (selector). bind (' click ', Function () { alert (' User clicked on ' foo. ');});can be directly replaced with the native JS:$ (selector). Click (function () { alert (' User clicked on ' foo. ');});In jQuery1.4.3, you can now replace an event handler by passing false instead. This will be equivalent to an
jquery Event Binding has four methods, corresponding to On,off,bind,unbind,delegate,undelegate,live,dieCompare and Contact:The 1.bind () function can only set events for elements that already exist, but live (), on (), delegate () Support event settings for new additions in the future;2.bind () function in the jquery1.
This example analyzes the bind (), Live (), delegate (), on () binding event method in jquery. Share to everyone for your reference, specific as follows:
Objective
Because the project often has the use of jquery operations DOM elements of additions and deletions, so it will involve the DOM element binding event way, simply summed up the difference between the B
the difference between. bind (),. Live (), and. Delegate () in jqueryReference: Http://www.jb51.net/article/27309.htmDOM TreeFirst, it is helpful to visualize the DOM tree of a HMTL document. A simple HTML page looks like this.event Bubbling (also known as event propagation)When we click on a link, it triggers the Click event of the link element, which raises any
1. bind ()
Description: binds an event handler to an element.
A basic usage of. bind:
$(selector).bind('click', function() { alert('User clicked on "foo."');});You can directly use native js instead:
$(selector).click( function() { alert('User clicked on "foo."');});In jQuery1.4.3, you can now pass false to replace an event handler. This is equivalent to an event
with on () since the jquery1.7 version. Live ()Brief description Live () adds one or more event handlers to the current or future matching element ;How to use$ (selector). Live (event,data,function)Event : required item; One or
Objective
Because the project often has the use of jquery operations DOM elements of additions and deletions, so it will involve the DOM elements of the binding event, simply summed up the difference between the Bind,live,delegate,on, so that later, and hope that the article will help the future of the Garden friends, If there is any improper in the text, I also hope that you will correct me, and say nothin
Details about bind (), live (), delegate (), on () binding event Method instances in jQuery, and jquerydelegate
This document analyzes bind (), live (), delegate (), and on () event binding methods in jQuery. We will share this with you for your reference. The details are as follows:
Preface
Because jquery is often use
Basic Elements
DOM tree
First, it is helpful to visualize the DOM tree of an hmtl document. A simple HTML page looks like this:Event bubbling (also known as event Propagation)
When we click a link, it triggers the Click Event of the link element. This event triggers the execution of any function on the click event that
In jquery, event binding methods are divided. bind (). live (). delegate (). Next I will give you a brief introduction to the three event binding methods. For more information, see.
Basic
First, graphical HTML documents can help us better understand. A simple HTML page looks like this
Event bubbling aka
ObjectiveBecause the project often has the use of jquery operations DOM element additions and deletions, it will involve the DOM elements of the binding event mode, a simple induction of the difference between the Bind,live,delegate,on, in order to consult later, but also hope that the article can help the park friends, If there are inappropriate in the text, but also hope that you correct, words do not say
Basis
First, a graphical HTML document can help us understand better. A simple HTML page should look like this
Event bubbling (also known as event delivery) (Event bubbling aka event propagation)Click on a link to trigger the Click event bound on the link element to trigge
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.