Hi all,
I have started to use Jquery a couple month ago, and i really love the
framework.
I am currently working on an event delegation plugin, attaching
generic event to the document and applying filters to the target
element to determine if an event should be applied.
I have however noticed some weird behavior for the .is() and .filter()
function :
I am using the latest jquery version 1.2.1 and am having some troubles
with the filter function.
If you use filter with an expression containing a space ( '.myClass a'
for example), nothing is filtered at all.
$('*').filter('.myClass a' ); returns all the nodes on the page.
Is it the expected behaviour ? Is there other ways to efficiently
check if a given node matches a given rule ?
document.addEventListener('click',
function(target){
if $(target).is('.myClass a'){
//do sth
}
if $(target).is('.myOtherClass
a'){
//do sth else
}
}
);
Thanks