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.