ouyang789987 / swfobject

Automatically exported from code.google.com/p/swfobject
0 stars 0 forks source link

swfobject.embedSW not working in IE7+; a outerHTML issue #411

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use swfobject.embedSW to embed an object.
2. Activate in IE7+
3. The object is not written.

What is the expected output? What do you see instead?
In FF 3 and 3.5.5, Safari (2 versions) and IE6, the object is rendered. 
What I see is an empty DIV container where other browsers are writing the
object.

What version of the product are you using? On what operating system?
v2.2; WinXP and Vista

Please provide any additional information below.
I found a jquery workaround on
http://www.wooliet.com/2009/07/22/swfobject-ie-and-dynamic-content-a-problem/com
ment-page-1/#comment-2962

where the author described using jquery replaceWith.  He also describes how
the failure is happening.

Original issue reported on code.google.com by sigotrat...@gmail.com on 2 Dec 2009 at 10:48

GoogleCodeExporter commented 9 years ago
i have to same issue.

I m unable to fix even with jQuery replaceWith

Original comment by mlaccess...@gmail.com on 25 Feb 2010 at 4:45

GoogleCodeExporter commented 9 years ago
var updated = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + 
att + '>' + par + 
'</object>';
$(el).replaceWith(updated);
//el.outerHTML = updated;

This works for me. Problem seems to occur when target div wasn't visible when 
page was loaded and .show()ed 
later.

Original comment by sensijko...@gmail.com on 13 Apr 2010 at 9:55

GoogleCodeExporter commented 9 years ago
had the same issue. resolved (hacky) by creating a wrapper div and then 
dynamically creating and adding a div for the swf.

    var newdiv = document.createElement('div'); 
    newdiv.setAttribute('id', 'flashcontent');  
        //remove the "you don't have flash" div
    document.getElementById('flashwrapper').removeChild(document.getElementById('noFlashDiv'));
        //add the new div
    document.getElementById('flashwrapper').appendChild(newdiv);

    swfobject.embedSWF("/swf/MySWF.swf", "flashcontent", "480", "340", "10.0.0", "/swf/expressInstall.swf", flashvars);

Original comment by babbel...@gmail.com on 29 Oct 2010 at 7:16

GoogleCodeExporter commented 9 years ago
@babbel not working at all in IE9

Original comment by cri...@gmail.com on 2 Feb 2011 at 7:24

GoogleCodeExporter commented 9 years ago
try updating your flash player, solved my issues!

Original comment by daniel.k...@gmail.com on 10 Mar 2011 at 9:06

GoogleCodeExporter commented 9 years ago
SWFObject 2.2 has been successfully tested in all major browsers, including 
IE6/7/8/9

If you need to remove a dynamically embedded SWF with a new SWF, try this:
http://learnswfobject.com/advanced-topics/load-a-swf-using-javascript-onclick-ev
ent/

(see "Replacing a loaded SWF with another SWF")

Original comment by platelu...@gmail.com on 17 May 2011 at 8:09