Duplicate binding instructions for live methods in jquery _jquery

Source: Internet
Author: User
Workaround: Use the Die () method to unbind the previously bound event on this element before the live () method is bound, and then bind the new event through the Live () method.

Copy Code code as follows:

First through the Die () method, and then through Live () binding
$ ("#selectAll"). Die (). Live ("Click", Function () {
Event Run code
});

Introduction to the Die () method:
Copy Code code as follows:

Die ([Type], [fn]) <span style= "White-space:normal" > </SPAN>

Overview
JQuery 1.3 is new. This approach is exactly the opposite of live.

If no parameters are taken, all the bound live events will be removed.

You can unlock custom events that are registered with live.

If the type parameter is provided, the corresponding live event is removed.

If the second parameter function is also specified, only the specified event handler is moved.

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.