nath_dearn
04-28-2004, 04:16 PM
Hello people,
Ok so I have a javascript problem. I have a page with a text link, when the mouse moves over the text link a small image to left of the link changes to another image of a different colour ( or atleast its supposed to) im getting the runtime error - 'rootpath' is undefined. Below is the javascript im using. The script is in a seperate file thats linked to the code ie
<SCRIPT language=JavaScript
src="Images/AW_scripts_ProjectSpecific.js">
</SCRIPT>
JAVASCRIPT CODE
//--------------------------------------------------------------
function awChangeBGColor(ID, color)
{
if (document.all) {
document.all[ID].style.backgroundColor = color;
return;
}
if (document.getElementById) {
document.getElementById(ID).style.backgroundColor = color;
return;
}
}
//--------------------------------------------------------------
function awCnangeImage(ID, imgPath)
{
if (document.images) {
imgFile = rootpath + imgPath;
document[ID].src = imgFile;
}
}
CODE END
I dont know what the rootpath is supposed to be defined as nor do I know what it reffers to, what is the rootpath?
Here is an example page with the error message:
http://www.extraordinarydesigns.co.uk/test/
Thank you for any help you maybe able to offer me on this problem,
Nathan
Ok so I have a javascript problem. I have a page with a text link, when the mouse moves over the text link a small image to left of the link changes to another image of a different colour ( or atleast its supposed to) im getting the runtime error - 'rootpath' is undefined. Below is the javascript im using. The script is in a seperate file thats linked to the code ie
<SCRIPT language=JavaScript
src="Images/AW_scripts_ProjectSpecific.js">
</SCRIPT>
JAVASCRIPT CODE
//--------------------------------------------------------------
function awChangeBGColor(ID, color)
{
if (document.all) {
document.all[ID].style.backgroundColor = color;
return;
}
if (document.getElementById) {
document.getElementById(ID).style.backgroundColor = color;
return;
}
}
//--------------------------------------------------------------
function awCnangeImage(ID, imgPath)
{
if (document.images) {
imgFile = rootpath + imgPath;
document[ID].src = imgFile;
}
}
CODE END
I dont know what the rootpath is supposed to be defined as nor do I know what it reffers to, what is the rootpath?
Here is an example page with the error message:
http://www.extraordinarydesigns.co.uk/test/
Thank you for any help you maybe able to offer me on this problem,
Nathan