kosmokramer
Programmer
Hey. I am making a rollover for one of my webpages which will take as arguments the image name, the width to make the image, and a description. When the link is rolled over, it will display in one cell of a table the picture and below it in another cell, the description.
The problem is that the text is not replaced by the new text, it is simply appended on the end of the first text. Also, and this is a minor problem, but since insertAdjacentHTML() is an IE only function, how do I make it compatable with Netscape?
Code:
function changeImage(theImage,newWidth,description)
{
theImageObject = document.all('imagePlaceHolder');
theImageObject.src=theImage;
theImageObject.width=newWidth;
descriptionHolder = document.all('theDescription');
descriptionHolder.insertAdjacentHTML('BeforeEnd', description);
}
The problem is that the text is not replaced by the new text, it is simply appended on the end of the first text. Also, and this is a minor problem, but since insertAdjacentHTML() is an IE only function, how do I make it compatable with Netscape?