Ticket #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: | |
| Blocking: | Blocked by: |
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
Change History
Changed 3 years ago by gittrac
-
attachment
ie6_object_before.rtf
added
comment:1 Changed 3 years ago by dmethvin
- Keywords ie6 added
- Component changed from unfiled to manipulation
comment:2 Changed 2 years ago by dmethvin
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 2 years ago by jitter
test case not a bug with before but with IE6 having problems with object/embed tags
comment:4 Changed 2 years ago by jitter
- Priority changed from major to low
- Version changed from 1.3.2 to 1.4.4
- Milestone changed from 1.4 to 1.5
comment:5 Changed 2 years ago by snover
- Status changed from new to closed
- Resolution set to invalid
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>
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

on I.E. 6 , failure to create <div> before <object> using '.before' manipulation