From: Raymond I. <xw...@ya...> - 2003-04-24 19:57:54
|
As for the addHTML() function .... // Before the page loads you can use addHTML to add regular html text to the document. // this will behave similar to the document.write() function in both ns4 and other browsers dynapi.document.addHTML('Some Text <b>here Some Text</b> here Some Text here Some Text here Some Text here Some Text here'); dynapi.onLoad(function(){ // After the page has been loaded the addHTML() function will behave differently in ns4 than in other browsers. // All HTML content added after the page has been loaded in ns4 will appear at location 0,0 // while in other browsers it will be appended to the end of the document. // It's best to use the addHTML() to add inline layers to the document after a page load. var html='<table border="1" width="100%"><tr><td>This is an inline layer that was created after page load</td></tr></table>'; if(dynapi.ua.ns4) dynapi.document.addHTML('<layer id="myid2" width="100" height="100" bgcolor="yellow">'+html+'</layer>'); else dynapi.document.addHTML('<div id="myid2" style="position:absolute;width:100px;height:100px;background-color:yellow;">'+html+'</div>'); var lyr = new DynLayer(); lyr.setID('myid2',true); dynapi.document.addChild(lyr); lyr.setLocation(100,100); lyr.setSize(150,100); lyr.setHTML(html); }); Should we keep the addHTML() function or remove it and have the users implement their own functions? -- Raymond Irving __________________________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo http://search.yahoo.com |