guowei1000
06-22-2004, 08:12 AM
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>
<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>