jquery .live() event interactions
- by ddango
Let's say I have a scenario where I have a global plugin (or at least a plugin that binds to a wider array of events).
This plugin takes a selector, and binds a live click to it. Something in pseudo-jquery that might look like this:
$.fn.changeSomething = function(){
$(this).live("change", function(){ alert("yo");});
}
On another page, I have an additional live binding something like this:
$("input[type='checkbox']").live("click", function(){alert("ho");});
Within this scenario, the checkbox would ideally end up being bound to both live events.
What I'm seeing is that the change event fires as it should, and I'm alerted "yo". However, using this live click event, I never trigger it. However, using an explicit click binding, I DO hit it.
The easy workaround is to trigger a click event at the end of the live change handler, but this seems janky to me. Any ideas?
Note that this is using jquery 1.4.2 and only occurs in IE8 (I supposed 6/7 would too, but I haven't tested them).