如何获取
目前唯一可访问的 ID 是“dialog1”。有了这些信息,我如何向下遍历以获取
我刚刚意识到我必须使用 Mootools 来完成此操作,因为脚本的其余部分是在其中编写的。我对 Mootools 完全陌生,你'
$('#dialog1').children('NOLOCALIZATION').children('object').attr('classid');似乎对我有用。我实际上正在使用 MooTools。我如何使用这个 jQuery 而不发生冲突?
<ul>
<li>
<a href="#dialog1" rel="vidbox" title="video">watch video</a>
</li>
</ul>
<div id="dialog1" class="window dialog" style="width: 806px; height:504px;">
<NOLOCALIZATION>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="806" height="504" id="http://www.youtube.com/watch?v=uhi5x7V3WXE">
<param name="wmode" value="transparent" />
<param name="movie" value="http://www.youtube.com/watch?v=uhi5x7V3WXE" />
<param name="allowFullScreen" value="true" />
<param name="allowscriptaccess" value="always" />
<param name="FlashVars" value="width=806&height=504&dart_zone_url=&cms_id=AllBusiness&content_id=16009601&auto_start=1&auto_mute=1&playPreroll=0&playtremor=0"/>
<object type="application/x-shockwave-flash" width="806" height="504" data="http://www.youtube.com/watch?v=uhi5x7V3WXE">
<param name="wmode" value="transparent" />
<param name="movie" value="http://www.youtube.com/watch?v=uhi5x7V3WXE" />
<param name="allowFullScreen" value="true" />
<param name="allowscriptaccess" value="always" />
<param name="FlashVars" value="width=806&height=504&dart_zone_url=&auto_start=1&auto_mute=1&playPreroll=0&playtremor=0"/>
</object>
</object>
</NOLOCALIZATION>
</div>
Only accessible id right now is "dialog1". Given that information how do I traverse down to get the <object classid>
?
I just realised that i've to do this with Mootools as the rest of the script is written in it. I'm completely new to Mootools thou'
$('#dialog1').children('NOLOCALIZATION').children('object').attr('classid'); seems to work for me. I'm actually using MooTools. How do I use this jQuery without conflicting?
<ul>
<li>
<a href="#dialog1" rel="vidbox" title="video">watch video</a>
</li>
</ul>
<div id="dialog1" class="window dialog" style="width: 806px; height:504px;">
<NOLOCALIZATION>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="806" height="504" id="http://www.youtube.com/watch?v=uhi5x7V3WXE">
<param name="wmode" value="transparent" />
<param name="movie" value="http://www.youtube.com/watch?v=uhi5x7V3WXE" />
<param name="allowFullScreen" value="true" />
<param name="allowscriptaccess" value="always" />
<param name="FlashVars" value="width=806&height=504&dart_zone_url=&cms_id=AllBusiness&content_id=16009601&auto_start=1&auto_mute=1&playPreroll=0&playtremor=0"/>
<object type="application/x-shockwave-flash" width="806" height="504" data="http://www.youtube.com/watch?v=uhi5x7V3WXE">
<param name="wmode" value="transparent" />
<param name="movie" value="http://www.youtube.com/watch?v=uhi5x7V3WXE" />
<param name="allowFullScreen" value="true" />
<param name="allowscriptaccess" value="always" />
<param name="FlashVars" value="width=806&height=504&dart_zone_url=&auto_start=1&auto_mute=1&playPreroll=0&playtremor=0"/>
</object>
</object>
</NOLOCALIZATION>
</div>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
或者我想:
或者
虽然我不确定浏览器如何处理
元素。在您评论需要动态版本之后:
虽然实际上您只需要通读 jQuery API 并发挥创意你的选择器。测试一下;看看什么有效;看看什么没有。
or i suppose:
or
although I'm not sure how the browser handles a
<NOLOCALIZATION>
element.After your comment about needing a dynamic version:
Although really you just need to read through the jQuery API and be creative with your selectors. Test things out; see what works; see what doesn't.
对于mootools:
http://jsfiddle.net/dimitar/XUyDU/
请注意,在 IE6-IE8 中, mootools 不会扩展 OBJECT 元素,因此 obj 将不会具有其他可用的
.get()
或 mootools 添加的任何其他 Element.proto。for mootools:
http://jsfiddle.net/dimitar/XUyDU/
notice that in IE6-IE8, mootools does NOT extend the OBJECT element, hence obj will NOT have the otherwise available
.get()
or any other Element.proto that mootools adds.