English 中文(简体)
j Query Selectedor Bug with <object>s in IE 6 & 7? 或者我错了东西。
原标题:jQuery Selector Bug with <object> element in IE 6 & 7? Or did I miss something

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>

以及相关的 j:

console.log(jQuery("#firstVideo param").length);
console.log(jQuery("#firstVideoWrap param").length);
console.log(jQuery("#secondVideo param").length);
console.log(jQuery("#secondVideoWrap param").length);

产出如下:

5
2
5
3

Here it is in JSFiddle: http://jsfiddle.net/uGpUy/2/

看来,电离层电离层电离层在物体上点数,而是在整页上点数。 当我使用包装时,它就正确地算起。

如果我也这样做的话:

jQuery("#secondVideo > param").length

这种做法是正确的。

难道这不是一种 j笑,还是我所说的东西在我的法典中是错误的吗?

EDIT:I ve提交了一个j Query bug票,用于:

最佳回答

该表与<代码><OBJECT /> tag有关。 请替换<代码><OBJECT /> tags with <DIV />tags,

2
2
3
3

http://jsfiddle.net/uGpUy/7/>rel=“nofollow> 我通过使用 代码“儿童(>,<OBJECT /> 选择:

console.log(jQuery("#firstVideo").children("param").length);
console.log(jQuery("#firstVideoWrap param").length);
console.log(jQuery("#secondVideo").children("param").length);
console.log(jQuery("#secondVideoWrap param").length);

<<>Outputs>

2
2
3
3

<>其他说明:

bug在.find(/a>,作为而不是。 归还:

5
2
5
3
问题回答

更糟糕的是,在IE8中,所有四个长度为0。 使用<条码>j Query("#secondVideo > param”也产生 0... 为什么会发生。





相关问题
IE6 floated element wrapping problеm

I am trying to get tags to wrap to the next line by left floating them. In firefox the text will wrap onto the start of the next line, however IE6 will wrap the text onto the line directly under the ...

IE color <dt> spill

I have made a page here the DT title is underline red with text white... in firefox everything is fine... but the dt spill in IE... why ? here is a VIEW of the problem ! Here is the perfect example ...

Website surfacing blank pages in IE6

- Since discovering more about my problem I have modified my question A single user is complaining that (on XP and using IE6) they re not able to follow any links around my site. The behaviour they ...

Why are some images rendering on IE6 and some are not?

the images are showing up in safari and firefox but not IE6. I have four images, two of them are showing up in IE6 and two are not. If it helps, they are being toggled with an if statement. ...

IE6 positioning issue

It works as intended in Safari, Firefox etc. But it is not reading the positioning or z-index in IE6. How can I make it layout as it should in IE6? Here is the CSS: .AuthorName_Pic { width: ...

Nasty IE6 <ul> <li> stair bug

In that page, the submenu if fine in firefox, but as usual, the nasty explorer is interpreting that differently.... how do you troubleshoot css bug in IE6 what is the css bud there ? here is the ...

radio button jquery ie6 problem

i am dynamically creating radio using jquery as shown belown. but they value only selected in ff,ie8. ie6,ie7 not selecting the values. how can i select the radio button value in ie6/7. rand=$("<...

How can I make my fixed position work in IE6?

I ve have tried this: body {height: 100%;overflow: auto; body #cornerImage {position: absolute;bottom: 0;} and this: { margin:0; padding:0; } html, body { height: 100%; overflow:auto; } ...

热门标签