Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-12-2007, 05:14 AM   PM User | #1
iridius
New to the CF scene

 
Join Date: Jun 2007
Location: Seattle
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
iridius is an unknown quantity at this point
Assistance with error in code, please

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:


The JavaScript:

Code:
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.
iridius is offline   Reply With Quote
Old 06-12-2007, 05:17 AM   PM User | #2
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
Try
Code:
var currentActor = myChar.getAttribute("line");
__________________
||||If you are getting paid to do a job, don't ask for help on it!||||

Last edited by _Aerospace_Eng_; 06-12-2007 at 05:19 AM..
_Aerospace_Eng_ is offline   Reply With Quote
Old 06-12-2007, 05:33 AM   PM User | #3
iridius
New to the CF scene

 
Join Date: Jun 2007
Location: Seattle
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
iridius is an unknown quantity at this point
Thank you!

Thanks! That worked perfectly
iridius is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:29 AM.


Advertisement
Log in to turn off these ads.