dcsimg
Read from div layer
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Joost_Schouten
Posted On:   Thursday, December 11, 2003 12:15 PM

Hi, I have a javascript that generates, hides, shows and repopulates div layers. However, I can't seem to make it read the content of the layer into a javascript var string. Does anyone know how I can alter the folowing script so it reads out the contenet in stead of setting it. A good online resource would also be very much appreciated. the script: function redraw() { if(standardCompliant){ range = document.createRange(); element = document.getElementById(this.id); range.setStartBefore(element); content = range.createContextualFragment(this.content) while(element.hasChildNodes()) element.removeChild(element.lastChild); element.appendChild(content)   More>>

Hi,


I have a javascript that generates, hides, shows and repopulates div layers. However, I can't seem to make it read the content of the layer into a javascript var string. Does anyone know how I can alter the folowing script so it reads out the contenet in stead of setting it. A good online resource would also be very much appreciated.


the script:

			
function redraw() {
if(standardCompliant){
range = document.createRange();
element = document.getElementById(this.id);
range.setStartBefore(element);
content = range.createContextualFragment(this.content)
while(element.hasChildNodes()) element.removeChild(element.lastChild);
element.appendChild(content);
}else if (NN4){
lyr=document.layers[this.id].document;
lyr.open();
lyr.write(this.content);
lyr.close();
}else if (IE4){
document.all[this.id].innerHTML = this.content;
}
}

Kind regards,

Joost


PS: note that the script is part of a larger layer object I created, and is just here as a reference.

   <<Less
About | Sitemap | Contact