Found a really weird problem with jQuery in IE7 today where it isn't finding selectors properly inside an element. Here's the HTML code:
<DIV id=firstVideoWrap>
<OBJECT style="FLOAT: left" id=firstVideo width=300 height=300>
<PARAM NAME="allowfullscreen" VALUE="true" />
<PARAM NAME="movie" VALUE="http://vimeo.com/">
</OBJECT>
</DIV>
<DIV id=secondVideoWrap>
<OBJECT style="FLOAT: left" id=secondVideo width=300 height=300>
<PARAM NAME="allowscriptaccess" VALUE="always" />
<PARAM NAME="movie" VALUE=http://vimeo.com/moogaloop.swf />
<PARAM NAME="wmode" VALUE="opaque" />
</OBJECT>
</DIV>
and the relevant javascript:
console.log(jQuery("#firstVideo param").length);
console.log(jQuery("#firstVideoWrap param").length);
console.log(jQuery("#secondVideo param").length);
console.log(jQuery("#secondVideoWrap param").length);
It is giving the output:
5
2
5
3
Here it is in JSFiddle: http://jsfiddle.net/uGpUy/2/
It seems that IE isn't counting the number of param's on an object and instead is counting all param's on the entire page. While when I use the wrapping div it counts them correctly.
Also If I do:
jQuery("#secondVideo > param").length
It works correctly.
Is this a jQuery bug or something I've done wrong in my code?
EDIT: I've submitted a jQuery bug ticket for this: http://bugs.jquery.com/ticket/11646, will see how that progresses.