[thelist] Creating Divs on the fly

Eric Costello eric at schwa.com
Thu Aug 10 10:48:50 CDT 2000


I wrote:
>>That is not true, it is possible to create new Divs in all the 4+ browser.
>>You must use javascript to do document.write()s, but you can do it
>>endlessly.

James wrote:
>Can you show me some code? I just re-wrote a whole bunch of javascript in
>PHP to run server side because I couldn't get it to work in Netscape.

Here is a good tutorial on how to do it:
http://www.dansteinman.com/dynduo/en/createdestroy.html

Just ignore the stuff at the bottom starting at "The createLayer() and
destroyLayer() Functions" which is about using Steinaman's dynAPI.

I was wrong about doing it with document.write()s, BTW (sorry!). You have to
talk to the "layer" object in NS, and use the "insertAdjacentHTML" method in
IE, but you /can/ create new Divs after page load.

Eric

Eric Costello
eric at schwa.com
http://glish.com





More information about the thelist mailing list