...

View Full Version : Assistance with error in code, please



iridius
06-12-2007, 06:14 AM
I am receiving the following error message in Firefox Error Console:

Error: myChar.attributes.getNamedItem("line") has no properties
Source File: http://www.iridiusprime.com/a7.html
Line: 16
The page is located here:
(http://www.iridiusprime.com/a7.html)

The JavaScript:


function hiLite(myActor)
{
var myDiv = document.getElementsByTagName("div");
for(var x=0; x<myDiv.length; x++)
{
var myChar = myDiv[x]
var currentActor = myChar.attributes.getNamedItem("line").nodeValue
if (currentActor == "action")
continue;
var myNewColor = myChar.getElementsByTagName("font");

for(var y=0; y<myNewColor.length; y++)
{
var myLines = myNewColor[y]
if(myActor == currentActor)
{
myLines.setAttribute("color","#CC0000");
}else{
myLines.setAttribute("color","#cccccc");
}
}
}
}


Any assistance would be appreciated. Thank you.

_Aerospace_Eng_
06-12-2007, 06:17 AM
Try

var currentActor = myChar.getAttribute("line");

iridius
06-12-2007, 06:33 AM
Thanks! That worked perfectly



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum