Add OBJECT in DIV
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Add OBJECT in DIV

From: Asterbing <no@thanks.com>
Date: Wed Nov 30 2005 - 21:50:32 CET

Hi. I'm trying to add an OBJECT in an existing DIV after a certain
delay.

Here is my currend code :

<div id="dummy" style="position: absolute; visibility: visible; top:
10px; left: 10px; z-index: 5; cursor: default; height: auto; background:
white; width: 500px; padding: 5px; overflow: hidden;>
<script language="JavaScript"><!--
        var code = document.createTextNode("<object width='400'
height='400' type='text/html' data='soon.htm'></object>");

        var obj = findObject("dummy"); // findObject existing in a .js
        
        setTimeout(function(){obj.appendChild(code);},60000);
//--></script>
</div>

The result is that after 60 seconds, the DIV contains the text
"("<object width='400' height='400' type='text/html' data='soon.htm'>
</object>" and not an interpreted object tag. How to add the object
rather than simple text ?
Received on Sat Dec 3 04:33:59 2005