D
DanielLinn
I'm getting an error in IE 6.0.2800 that says "Error: Not implemented."
when I try to get a parent. Does it whether or not 'compatibility
mode' is on.
Here's my code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>User Results</title>
<link href="css/screen.css" rel="stylesheet" media="all" />
<script type="text/javascript" language="javascript">
function highlightRow(elem) {
alert(elem.parentNode.parentNode.id);
parent = findOwner( elem );
parent.className = "highlighted";
}
function findOwner( elem )
{
var node = elem;
while (node)
{
if ( node.nodeType == node.ELEMENT_NODE && node.nodeName == "TR")
{
alert("found it");
return node;
}
node = node.parentNode;
}
alert("didn't find it");
return null;
}
</script>
</head>
<body>
<table cellspacing="0" id="scrollMe" class="formdata">
<tr id="rowThing">
<td class="center command" id="tdThing"><input id="testingThis"
type="checkbox" class="checkEm" name="vehIndex_0"
onclick="highlightRow(this);" value="0"/>
</td>
</tr>
</table>
</body>
</html>
What's odd is that the first alert will return the proper ID of the row
(using parentNode), but when I use parentNode to assign the parent to a
var, it chokes. Works fine on Moz (surprise, surprise). Any ideas?
when I try to get a parent. Does it whether or not 'compatibility
mode' is on.
Here's my code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>User Results</title>
<link href="css/screen.css" rel="stylesheet" media="all" />
<script type="text/javascript" language="javascript">
function highlightRow(elem) {
alert(elem.parentNode.parentNode.id);
parent = findOwner( elem );
parent.className = "highlighted";
}
function findOwner( elem )
{
var node = elem;
while (node)
{
if ( node.nodeType == node.ELEMENT_NODE && node.nodeName == "TR")
{
alert("found it");
return node;
}
node = node.parentNode;
}
alert("didn't find it");
return null;
}
</script>
</head>
<body>
<table cellspacing="0" id="scrollMe" class="formdata">
<tr id="rowThing">
<td class="center command" id="tdThing"><input id="testingThis"
type="checkbox" class="checkEm" name="vehIndex_0"
onclick="highlightRow(this);" value="0"/>
</td>
</tr>
</table>
</body>
</html>
What's odd is that the first alert will return the proper ID of the row
(using parentNode), but when I use parentNode to assign the parent to a
var, it chokes. Works fine on Moz (surprise, surprise). Any ideas?