Opened 13 years ago
Closed 12 years ago
#5724 closed bug (invalid)
'before' can not be realized when applied to <object> on I.E. 6
Reported by: | gittrac | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | 1.5 |
Component: | manipulation | Version: | 1.4.4 |
Keywords: | before object ie6 | Cc: | |
Blocked by: | Blocking: |
Description
I have tried to use $("object").before("simple test") and it won't work on I.E. 6 ( haven't tried I.E. 7+). Is this a known issue? Or is it an issue at all? Any other way to add a "<div>" with identifier before "<object>"?
sample code: see the following
<html> <head> <style type="text/css"> </style> </head> <body> <br> I don't understand. <br> <object width="425" height="355" id="obj">
<param name="movie" value="http://www.youtube.com/v/0Bmhjf0rKe8w?rel=1&fs=1"></param> <param name="allowFullScreen" value="true"></param> <param name="allowScriptAccess" value="true"></param> <embed src="http://www.youtube.com/v/0Bmhjf0rKe8?rel=1&fs=1" type="application/x-shockwave-flash" width="425" height="355" allowfullscreen="true" allowscriptaccess="true"></embed>
</object> <br> <br> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"> </script> <script type="text/javascript"> $(document).ready(function() {
$("object").before("<div>ok, a simpler version, does it work?</div>");
}); </script> </body> </html>
Attachments (1)
Change History (6)
Changed 13 years ago by
Attachment: | ie6_object_before.rtf added |
---|
comment:1 Changed 13 years ago by
Component: | unfiled → manipulation |
---|---|
Keywords: | ie6 added |
comment:2 Changed 12 years ago by
http://jsfiddle.net/dmethvin/cp3Qh/
Worked for me in IE8; I didn't have IE6 to test so I'll leave it as new.
comment:3 Changed 12 years ago by
test case not a bug with before but with IE6 having problems with object/embed tags
comment:4 Changed 12 years ago by
Milestone: | 1.4 → 1.5 |
---|---|
Priority: | major → low |
Version: | 1.3.2 → 1.4.4 |
comment:5 Changed 12 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
Thanks for the report, but this is not a jQuery bug. The <object>
code you are using is invalid, so IE6/7 use the inner <embed>
and drop the outer <object>
from the DOM. While this behaviour is technically incorrect, all you need to do is append before the <embed>
instead, or fix the HTML so it looks like this:
<object width="425" height="355" type="application/x-shockwave-flash" data="http://www.youtube.com/v/FpjyCE-R4Y4?fs=1&hl=en_US" id="obj"> <param name="movie" value="http://www.youtube.com/v/FpjyCE-R4Y4?fs=1&hl=en_US"/> <param name="allowFullScreen" value="true"/> <param name="allowScriptAccess" value="true"/> </object>
on I.E. 6 , failure to create <div> before <object> using '.before' manipulation