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 6 of 6
  1. #1
    New Coder
    Join Date
    May 2004
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Internet Explorer help it keep giving error... :(

    it said method not supported at line 97 ... can anyone help me ? its around the area i put HERE... its not included in the code of course but i just wanna to show where the error was
    <html>
    <head>
    <script type="text/javascript">
    var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
    xmlDoc.load("note.xml");
    function TestChildren(nodes) // write the first layer out
    {
    document.writeln("<table border = 1>");
    document.writeln("<tr>");
    document.writeln("<td>");
    document.writeln("<A onClick='javaScript:toogle_state(this)'><font color= red><IMG SRC='minus.gif'>"+ nodes.nodeName +"</font></A>");
    if (nodes.hasChildNodes)
    {
    document.writeln("<DIV>");
    for (var i=0; i < nodes.childNodes.length; i++)
    {
    document.writeln("<table border = 1>");
    document.writeln("<tr>");
    document.writeln("<td>");
    if (nodes.childNodes(i).hasChildNodes) // add toogle in
    {
    if(nodes.childNodes(i).getAttribute("url"))
    {
    document.writeln("<font color= red><A onClick='javascript:toogle_state(this)'" + "href = " + nodes.childNodes(i).getAttribute("url") + " &nbps " + "target = 'sidethingy'" +"><IMG SRC='minus.gif'>"+nodes.childNodes(i).nodeName +"</A></font>");
    writechildren(nodes.childNodes(i))
    }
    else
    {
    document.writeln("<font color= red><A onClick='javascript:toogle_state(this)'><IMG SRC='minus.gif'>"+nodes.childNodes(i).nodeName +"</A></font>");
    writechildren(nodes.childNodes(i))
    }
    }
    else
    {
    if (nodes.childNodes(i).getAttribute("url"))
    {
    document.writeln("<A href=" + nodes.childNodes(i).getAttribute("url") + " &nbps " + "target=sidethingy"+ ">" + nodes.childNodes(i).nodeName + "</A>");
    }
    else
    {
    document.writeln(nodes.childNodes(i).nodeName);
    }
    }
    document.writeln("</td>");
    document.writeln("</tr>");
    document.writeln("</table>");
    }
    document.writeln("</DIV>");
    }
    document.writeln("</td>");
    document.writeln("</tr>");
    document.writeln("</table>");
    }
    function writechildren(sianz)
    {
    if (sianz.hasChildNodes)
    {
    document.writeln("<DIV>");
    for (var i=0; i < sianz.childNodes.length; i++) // check the length of the childNOdes
    {
    document.writeln("<table border = 1>");
    document.writeln("<tr>");
    document.writeln("<td>");
    if (sianz.childNodes(i).hasChildNodes) // add toogle in
    {
    if (sianz.childNodes(i).nodeName == "#text")
    {
    if(sianz.childNodes(i).getAttribute("url"))
    {
    document.writeln("<font color= red><A onClick='javascript:toogle_state(this)'" + "href = " + sianz.childNodes(i).getAttribute("url") + " &nbps " + "target = 'sidethingy'" +"><IMG SRC='minus.gif'>"+ sianz.childNodes(i).text + "</A></font>");
    writechildren(sianz.childNodes(i))
    }
    else
    {
    document.writeln("<font color= red><A onClick='javascript:toogle_state(this)'><IMG SRC='minus.gif'>"+ sianz.childNodes(i).text + "</A></font>");
    writechildren(sianz.childNodes(i))
    }
    }
    else
    {
    if(sianz.childNodes(i).getAttribute("url"))
    {
    document.writeln("<font color= red><A onClick='javascript:toogle_state(this)'" + "href = " + sianz.childNodes(i).getAttribute("url") + " &nbps " + "target = 'sidethingy'" +"><IMG SRC='minus.gif'> "+ sianz.childNodes(i).nodeName + "</A></font>");
    writechildren(sianz.childNodes(i))
    }
    else
    {
    document.writeln("<font color= red><A onClick='javascript:toogle_state(this)'><IMG SRC='minus.gif'> "+ sianz.childNodes(i).nodeName + "</A></font>");
    writechildren(sianz.childNodes(i))
    }

    }
    }
    else
    {
    if(sianz.childNodes(i).nodeName == "#text")
    {
    if(sianz.childNodes(i).getAttribute("url"))
    {
    document.writeln("<A href=" + sianz.childNodes(i).getAttribute("url") + " &nbps " + "target=sidethingy"+ ">" + sianz.childNodes(i).text + "</A>");
    writechildren(sianz.childNodes(i))
    }
    else
    {
    document.writeln(sianz.childNodes(i).text);
    writechildren(sianz.childNodes(i))
    }
    }
    else
    {
    if(sianz.childNodes(i).getAttribute("url"))
    {
    document.writeln("<A href=" + sianz.childNodes(i).getAttribute("url") + " &nbps " + "target=sidethingy" + ">" + sianz.childNodes(i).nodeName + "</A>");
    writechildren(sianz.childNodes(i))
    }
    else
    {
    document.writeln(sianz.childNodes(i).nodeName);
    writechildren(sianz.childNodes(i))
    }
    }
    }
    document.writeln("</td>");
    document.writeln("</tr>");
    document.writeln("</table>");
    }
    }
    }

    function toogle_state(nodeCounter) // this toogle the state and pass info to the sideView.html side
    {
    var location = nodeCounter.sourceIndex // locate the location of the nodeCounter
    var locationIMG = document.all[location + 1] //this locate the IMG tag for this
    var nextDivLocation = document.all[location+2] // location the DIV
    if (nextDivLocation.style.display =="")
    {
    nextDivLocation.style.display = "none"
    locationIMG.src = "plus.gif";
    }
    else
    {
    nextDivLocation.style.display = ""
    locationIMG.src = "minus.gif";
    //var stFrame = parent.frames['sidethingy']; // pass data to the other frame
    //stFrame.controlText(nextDivLocation.innerText);
    }
    }
    function callReadXml()
    {
    root = xmlDoc.documentElement;
    TestChildren(root);
    }
    </script>
    </head>
    <body>
    <script type="text/javascript">
    callReadXml();
    </script>
    </body>
    </html>

  • #2
    New Coder
    Join Date
    May 2004
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts
    sry for the double post, forget to add in the "HERE"

    <html>
    <head>
    <script type="text/javascript">
    var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
    xmlDoc.load("note.xml");
    function TestChildren(nodes) // write the first layer out
    {
    document.writeln("<table border = 1>");
    document.writeln("<tr>");
    document.writeln("<td>");
    document.writeln("<A onClick='javaScript:toogle_state(this)'><font color= red><IMG SRC='minus.gif'>"+ nodes.nodeName +"</font></A>");
    if (nodes.hasChildNodes)
    {
    document.writeln("<DIV>");
    for (var i=0; i < nodes.childNodes.length; i++)
    {
    document.writeln("<table border = 1>");
    document.writeln("<tr>");
    document.writeln("<td>");
    if (nodes.childNodes(i).hasChildNodes) // add toogle in
    {
    if(nodes.childNodes(i).getAttribute("url"))
    {
    document.writeln("<font color= red><A onClick='javascript:toogle_state(this)'" + "href = " + nodes.childNodes(i).getAttribute("url") + " &nbps " + "target = 'sidethingy'" +"><IMG SRC='minus.gif'>"+nodes.childNodes(i).nodeName +"</A></font>");
    writechildren(nodes.childNodes(i))
    }
    else
    {
    document.writeln("<font color= red><A onClick='javascript:toogle_state(this)'><IMG SRC='minus.gif'>"+nodes.childNodes(i).nodeName +"</A></font>");
    writechildren(nodes.childNodes(i))
    }
    }
    else
    {
    if (nodes.childNodes(i).getAttribute("url"))
    {
    document.writeln("<A href=" + nodes.childNodes(i).getAttribute("url") + " &nbps " + "target=sidethingy"+ ">" + nodes.childNodes(i).nodeName + "</A>");
    }
    else
    {
    document.writeln(nodes.childNodes(i).nodeName);
    }
    }
    document.writeln("</td>");
    document.writeln("</tr>");
    document.writeln("</table>");
    }
    document.writeln("</DIV>");
    }
    document.writeln("</td>");
    document.writeln("</tr>");
    document.writeln("</table>");
    }
    function writechildren(sianz)
    {
    if (sianz.hasChildNodes)
    {
    document.writeln("<DIV>");
    for (var i=0; i < sianz.childNodes.length; i++) // check the length of the childNOdes
    {
    document.writeln("<table border = 1>");
    document.writeln("<tr>");
    document.writeln("<td>");
    if (sianz.childNodes(i).hasChildNodes) // add toogle in
    {
    if (sianz.childNodes(i).nodeName == "#text")
    {
    if(sianz.childNodes(i).getAttribute("url"))
    {
    document.writeln("<font color= red><A onClick='javascript:toogle_state(this)'" + "href = " + sianz.childNodes(i).getAttribute("url") + " &nbps " + "target = 'sidethingy'" +"><IMG SRC='minus.gif'>"+ sianz.childNodes(i).text + "</A></font>");
    writechildren(sianz.childNodes(i))
    }
    else
    {
    document.writeln("<font color= red><A onClick='javascript:toogle_state(this)'><IMG SRC='minus.gif'>"+ sianz.childNodes(i).text + "</A></font>");
    writechildren(sianz.childNodes(i))
    }
    }
    else
    {
    if(sianz.childNodes(i).getAttribute("url"))
    {
    document.writeln("<font color= red><A onClick='javascript:toogle_state(this)'" + "href = " + sianz.childNodes(i).getAttribute("url") + " &nbps " + "target = 'sidethingy'" +"><IMG SRC='minus.gif'> "+ sianz.childNodes(i).nodeName + "</A></font>");
    writechildren(sianz.childNodes(i))
    }
    else
    {
    document.writeln("<font color= red><A onClick='javascript:toogle_state(this)'><IMG SRC='minus.gif'> "+ sianz.childNodes(i).nodeName + "</A></font>");
    writechildren(sianz.childNodes(i))
    }

    }
    }
    else
    {
    if(sianz.childNodes(i).nodeName == "#text")
    {
    HERE if(sianz.childNodes(i).getAttribute("url"))
    {
    document.writeln("<A href=" + sianz.childNodes(i).getAttribute("url") + " &nbps " + "target=sidethingy"+ ">" + sianz.childNodes(i).text + "</A>");
    writechildren(sianz.childNodes(i))
    }
    else
    {
    document.writeln(sianz.childNodes(i).text);
    writechildren(sianz.childNodes(i))
    }
    }
    else
    {
    if(sianz.childNodes(i).getAttribute("url"))
    {
    document.writeln("<A href=" + sianz.childNodes(i).getAttribute("url") + " &nbps " + "target=sidethingy" + ">" + sianz.childNodes(i).nodeName + "</A>");
    writechildren(sianz.childNodes(i))
    }
    else
    {
    document.writeln(sianz.childNodes(i).nodeName);
    writechildren(sianz.childNodes(i))
    }
    }
    }
    document.writeln("</td>");
    document.writeln("</tr>");
    document.writeln("</table>");
    }
    }
    }

    function toogle_state(nodeCounter) // this toogle the state and pass info to the sideView.html side
    {
    var location = nodeCounter.sourceIndex // locate the location of the nodeCounter
    var locationIMG = document.all[location + 1] //this locate the IMG tag for this
    var nextDivLocation = document.all[location+2] // location the DIV
    if (nextDivLocation.style.display =="")
    {
    nextDivLocation.style.display = "none"
    locationIMG.src = "plus.gif";
    }
    else
    {
    nextDivLocation.style.display = ""
    locationIMG.src = "minus.gif";
    //var stFrame = parent.frames['sidethingy']; // pass data to the other frame
    //stFrame.controlText(nextDivLocation.innerText);
    }
    }
    function callReadXml()
    {
    root = xmlDoc.documentElement;
    TestChildren(root);
    }
    </script>
    </head>
    <body>
    <script type="text/javascript">
    callReadXml();
    </script>
    </body>
    </html>

  • #3
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,037
    Thanks
    0
    Thanked 250 Times in 246 Posts
    Quote Originally Posted by guowei1000
    sry for the double post, forget to add in the "HERE"
    FYI, you can edit your post by clicking the Edit button.

    It's also better that you put your codes in between [code][/code] tags so that they are more readable. You can also highlight the word HERE so that it's easier to find. That way, more people will be inclined to help you.

    Just a suggestion...

  • #4
    New Coder
    Join Date
    May 2004
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ok! let me try again.... lets go!
    I keep having problem with this code as it keep saying it doest not support the method around line 97 that i had highLight, hope someone can help Thanks

    Code:
    <html>
    <head>
    <script type="text/javascript">
    var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
    xmlDoc.load("note.xml");
    function TestChildren(nodes) // write the first layer out
    {
    	document.writeln("<table border = 1>");
    	document.writeln("<tr>");
    	document.writeln("<td>");
    	document.writeln("<A onClick='javaScript:toogle_state(this)'><font color= red><IMG SRC='minus.gif'>"+ nodes.nodeName +"</font></A>");
    	if (nodes.hasChildNodes)
    		{
    	document.writeln("<DIV>");
    		for (var i=0; i < nodes.childNodes.length; i++)
    			{
    			document.writeln("<table border = 1>");
    			document.writeln("<tr>");
    			document.writeln("<td>");
    				if (nodes.childNodes(i).hasChildNodes) // add toogle in 
    					{
    						if(nodes.childNodes(i).getAttribute("url"))
    						{
    							document.writeln("<font color= red><A onClick='javascript:toogle_state(this)'" + "href = " + nodes.childNodes(i).getAttribute("url") + " &nbps " + "target = 'sidethingy'" +"><IMG SRC='minus.gif'>"+nodes.childNodes(i).nodeName +"</A></font>");
    							writechildren(nodes.childNodes(i))
    						}
    						else
    						{
    							document.writeln("<font color= red><A onClick='javascript:toogle_state(this)'><IMG SRC='minus.gif'>"+nodes.childNodes(i).nodeName +"</A></font>");
    							writechildren(nodes.childNodes(i))
    						}
    					}
    				else 
    					{
    						if (nodes.childNodes(i).getAttribute("url"))
    						{
    						document.writeln("<A href=" + nodes.childNodes(i).getAttribute("url") + " &nbps " + "target=sidethingy"+ ">" +  nodes.childNodes(i).nodeName + "</A>");
    						}
    						else
    						{
    						document.writeln(nodes.childNodes(i).nodeName);
    						}
    					}
    			document.writeln("</td>");
    			document.writeln("</tr>");
    			document.writeln("</table>");
    			}
    	document.writeln("</DIV>");
    		}
    	document.writeln("</td>");
    	document.writeln("</tr>");
    	document.writeln("</table>");
    }
    function writechildren(sianz)
    {
    	if (sianz.hasChildNodes)
    	{
    	document.writeln("<DIV>");
    		for (var i=0; i < sianz.childNodes.length; i++) // check the length of the childNOdes
    			{
    			document.writeln("<table border = 1>");
    			document.writeln("<tr>");
    			document.writeln("<td>");
    			if (sianz.childNodes(i).hasChildNodes) // add toogle in 
    				{
    					if (sianz.childNodes(i).nodeName == "#text")
    					{
    						if(sianz.childNodes(i).getAttribute("url"))
    							{
    							document.writeln("<font color= red><A onClick='javascript:toogle_state(this)'" + "href = " + sianz.childNodes(i).getAttribute("url") + " &nbps " + "target = 'sidethingy'" +"><IMG SRC='minus.gif'>"+ sianz.childNodes(i).text + "</A></font>");
    							writechildren(sianz.childNodes(i))
    							}
    						else 
    							{
    							document.writeln("<font color= red><A onClick='javascript:toogle_state(this)'><IMG SRC='minus.gif'>"+ sianz.childNodes(i).text + "</A></font>");
    							writechildren(sianz.childNodes(i))
    							}
    					}
    			 		else
    					{
    						if(sianz.childNodes(i).getAttribute("url"))
    							{
    							document.writeln("<font color= red><A onClick='javascript:toogle_state(this)'" + "href = " + sianz.childNodes(i).getAttribute("url") + " &nbps " + "target = 'sidethingy'" +"><IMG SRC='minus.gif'> "+ sianz.childNodes(i).nodeName + "</A></font>");
    							writechildren(sianz.childNodes(i))
    							}
    						else 
    							{
    							document.writeln("<font color= red><A onClick='javascript:toogle_state(this)'><IMG SRC='minus.gif'> "+ sianz.childNodes(i).nodeName + "</A></font>");
    							writechildren(sianz.childNodes(i))
    							}
    						
    					}
    				}
    			else 
    				{
    					if(sianz.childNodes(i).nodeName == "#text")
    					{
    					if(sianz.childNodes(i).getAttribute("url"))
    						{
    							document.writeln("<A href=" + sianz.childNodes(i).getAttribute("url") + " &nbps " + "target=sidethingy"+ ">" + sianz.childNodes(i).text + "</A>");
    							writechildren(sianz.childNodes(i))
    						}
    						else
    						{
    							document.writeln(sianz.childNodes(i).text);
    							writechildren(sianz.childNodes(i))
    						}
    					}
    					else
    					{
    						if(sianz.childNodes(i).getAttribute("url"))
    						{
    							document.writeln("<A href=" + sianz.childNodes(i).getAttribute("url") + " &nbps " + "target=sidethingy" + ">" + sianz.childNodes(i).nodeName + "</A>");
    							writechildren(sianz.childNodes(i))
    						}
    						else
    						{
    							document.writeln(sianz.childNodes(i).nodeName);
    							writechildren(sianz.childNodes(i))
    						}
    					}
    				}
    			document.writeln("</td>");
    			document.writeln("</tr>");
    			document.writeln("</table>");
    			}
    		}
    }
    
    function toogle_state(nodeCounter) // this toogle the state and pass info to the sideView.html side
    {	
    	var location = nodeCounter.sourceIndex // locate the location of the nodeCounter
    	var locationIMG = document.all[location + 1] //this locate the IMG tag for this
    	var nextDivLocation = document.all[location+2] // location the DIV 
    		if (nextDivLocation.style.display =="")
    			{
    			nextDivLocation.style.display = "none"
    			locationIMG.src = "plus.gif";
    			}
    		else
    			{
    			nextDivLocation.style.display = ""
    			locationIMG.src = "minus.gif";
    //var stFrame = parent.frames['sidethingy']; // pass data to the other frame
    //stFrame.controlText(nextDivLocation.innerText);
    			}
    }
    function callReadXml()
    {
    root = xmlDoc.documentElement;
    TestChildren(root);
    }
    </script>
    </head>
    <body>
    <script type="text/javascript">
    callReadXml();
    </script>
    </body>
    </html>

  • #5
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,037
    Thanks
    0
    Thanked 250 Times in 246 Posts
    Text nodes (#text) represent the text of an element or attribute, so they don't have attributes and cannot have children.

  • #6
    New Coder
    Join Date
    May 2004
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts
    :O i din know that! Thanks alot!


  •  

    Posting Permissions

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