I'm using jQuery-1.1.1.js.
I have the following js code:
$("#componentId #menuId").bind("click", function(e) {
//do something useful.
});
and this markup:
<div id="componentId">
<div id="menuId">Text</div>
</div>
This works ok... but, suppose that the generated markup will not contain a div with "componentId" ID, as below:
<div id="anotherComponentId">
<div id="menuId">Text</div>
</div>
... then the script will throw an error at the line 954 :
if ( m[1] == "#" && ret[ret.length-1].getElementById ) {
I know that this issue can be avoided by changing my query code to:
$("#componentId").find("#menuId").bind("click", function(e) {
//do something useful.
});
instead of
$("#componentId #menuId").bind("click", function(e) {
//do something useful.
});
... still I think this is a bug which could be fixed. What do you think?
Thank you!
Regards,
Alex.
PS: I enjoy jQuery very much, it is a wonderful library. Keep doing a great job!