jquery on 的问题


return false from within a jQuery event handler is effectively the same as calling both e.preventDefaultand e.stopPropagation on the passed jQuery.Event object.
e.preventDefault() will prevent the default event from occuring, e.stopPropagation() will prevent the evet from bubbling up and return false will do both. Note that this behaviour differs from normal (non-jQuery) event handlers, in which, notably, return false does not stop the event from bubbling up.
所以on前半部分的selector必须是静态的。

评论

热门博文