I'm new to jq开发者_运维知识库uery. When I was using .live('click', handler) instead of .click(handler), I found the event handler can be triggered even though the object is disabled! Is this a bug of .live() all it is an anticipated behavior? And if do not want the side effect, what should I do? Thanks!
Looks like a bug.
As an alternative/workaround, use this instead:
$('#myForm').delegate('#myButton', 'click', handler);
Here's a fiddle showing that this does produce the desired results: http://www.jsfiddle.net/YcS8A/
精彩评论