Bug Tracker

Opened 10 years ago

Closed 9 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)

ie6_object_before.rtf (1.1 KB) - added by gittrac 10 years ago.
on I.E. 6 , failure to create <div> before <object> using '.before' manipulation

Download all attachments as: .zip

Change History (6)

Changed 10 years ago by gittrac

Attachment: ie6_object_before.rtf added

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

comment:1 Changed 9 years ago by dmethvin

Component: unfiledmanipulation
Keywords: ie6 added

comment:2 Changed 9 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 9 years ago by jitter

test case not a bug with before but with IE6 having problems with object/embed tags

comment:4 Changed 9 years ago by jitter

Milestone: 1.41.5
Priority: majorlow
Version: 1.3.21.4.4

comment:5 Changed 9 years ago by snover

Resolution: invalid
Status: newclosed

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&amp;hl=en_US" id="obj">
    <param name="movie" value="http://www.youtube.com/v/FpjyCE-R4Y4?fs=1&amp;hl=en_US"/>
    <param name="allowFullScreen" value="true"/>
    <param name="allowScriptAccess" value="true"/>
</object>
Last edited 9 years ago by snover (previous) (diff)
Note: See TracTickets for help on using tickets.