Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jun 2007
    Location
    Seattle
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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.

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Try
    Code:
    var currentActor = myChar.getAttribute("line");
    Last edited by _Aerospace_Eng_; 06-12-2007 at 05:19 AM.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    New to the CF scene
    Join Date
    Jun 2007
    Location
    Seattle
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thank you!

    Thanks! That worked perfectly


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •