views:

35

answers:

2

Hi all,

I'm new to jquery. 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!

+2  A: 

Looks like a bug.

Darin Dimitrov
And this happens on IE8. chorme does not have this problem
Roy
+1  A: 

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/

mkoistinen