Re: Dynamic HTML Creation

From: Date: Sat, 28 Aug 2004 06:58:20 +0000
Subject: Re: Dynamic HTML Creation
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-194986@lists.php.net to get a copy of this message
On Fri, 27 Aug 2004 23:17:29 -0700, Sam Hobbs <socalsam@bigfoot.com> wrote: > Is it possible to use the DOM to add (HTML) elements to a page at the time > the page is being shown? The HTML and VBScript shown below is a simplified > version of what I need to do but of course I need to do it in PHP. Since PHP > is server-side (right?) perhaps it is not possible. > You're right, it's not possible. You'd have to create the whole page with DOM and output it at the end. You may be able to use DOM to make a specific piece and inject it.... You could always just use JavaScript to inject things as wel. > <HTML> > <HEAD> > <Title>Dynamic Table Demo</Title> > </HEAD> > > <Script Language=VBScript> > Sub Window_Onload > Set NewRow = document.createElement("TR") > Set NewCell = document.createElement("TD") > NewCell.innerText = "Cell Text" > NewRow.appendChild NewCell > TableBody.appendChild NewRow > End Sub > </Script> > > <Body> > <h1>Dynamic Table Demo</h1> > > <Table Id=NewTable Cols=1 border=1 Width=50%> > <TBody Id=TableBody> > </TBody> > </Table> > > </Body> > </HTML> > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > !DSPAM:412fc78a52836398416238! > > -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin--

« previous php.general (#194986) next »