It is said that document.write is not a good practice, and also does not work after window.onload, which is the case I need. I have the following function that I need to change the document.write, the detail is that I need the content to be added in the same tag / element that is the call of the dento function of the tag, without the parent element being always the same.
function GerarSWF($arquivo,$largura,$altura,$id){
document.writeln(' <object type="application/x-shockwave-flash" id="' + $id + '" data="' + $arquivo + '" width="' + $largura + '" height="' + $altura + '">');
document.writeln(' <param name="movie" value="' + $arquivo + '" />');
document.writeln(' <param name="menu" value="false" />');
document.writeln(' <param name="wmode" value="transparent" />');
document.writeln(' <embed src="' + $arquivo + '" type="application/x-shockwave-flash" wmode="transparent" menu="false" quality="high" id="' + $id + '" width="' + $largura + '" height="' + $altura + '"></embed>');
document.writeln(' </object>');
}
Situation example:
<html>
<body>
<div id="pode_nem_sempre_ser_o_mesmo">
<div>
<script>GerarSWF(bla,bla);
//o conteudo tem q ficar dentro dessa div q está o <script>
//mas pode aparecer em locais diversos, nem sempre saberei o id ou tag
</script>
</div>
</div>
</body>
How can you do this? Thank you in advance for your attention.