Hi Burak.
Good to see you on the list.
I think what you are seeing is from when SWFObject 2.x replaces the content
originally with embedSWF() (rather than the remove method). When you specify
a target <div> in embedSWF(), if the Flash detection is successful then the
entire <div> is REPLACED by the <object> tag for the swf definition. When
you call removeSWF(), the <object> is deleted, but the original <div>
reference was already gone when embedSWF() ran. The SWFObject 2.x behaviour
is differnt to the old SWFObject 1.x behaviour where it only modified the
innerHTML of the target <div>.
If things like styling / positioning are needed for the <object>, then
generally how people do it is to create a parent wrapper <div> and style
that. When the inner <div> is overwritten with the <object> then the parent
styling / position remains.
If you needed to write some innerHTML after removing the swf <object> then
you could grab the parent <div> and add a child to it. Something like:
//Support function: creates an empty//element to replace embedded SWF
objectfunction replaceSwfWithEmptyDiv(targetID){
var el = document.getElementById(targetID);
if(el){
var div = document.createElement("div");
el.parentNode.insertBefore(div, el);
//Remove the SWF
swfobject.removeSWF(targetID);
//Give the new DIV the old element's ID
div.setAttribute("id", targetID);
}}
After that, you could write into the innerHTML.
Hope that helps.
Cheers,
Aran
2010/3/3 Burak Kuyucaklı <[email protected]>
> Hi,
>
> "swfobject.removeSWF( id )" method also removes the div that swf is
> embedded but i need the deleted div for replacing innerHtml.
>
> How can i remove only swf content not the div ?
>
> Thank you all.
>
> --
> You received this message because you are subscribed to the Google Groups
> "SWFObject" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<swfobject%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/swfobject?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups
"SWFObject" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/swfobject?hl=en.