In an attempt to answer another question in this group, I've had to resort
to calling the DOM method, Node.removeChil d(), using a reference to it
(long story...). That is, passing Node.removeChil d.
In Opera (7.23/Win), the call appears to do nothing - the node remains -
but no errors are shown. In Netscape (7.0/Win), an exception results[1].
On IE (6.0/Win), the node is removed.
Strangly, if I pass another function reference, say window.alert or a
user-defined function, there is no problem.
This illustrates the problem:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<title>Functi on reference test</title>
<script type="text/javascript">
function executeRef( func, arg ) {
func( arg );
}
function performRefTest( ) {
var elem = document.getEle mentById('testD iv');
executeRef( elem.parentNode .removeChild, elem );
}
</script>
</head>
<body onload="perform RefTest()">
<div id="testDiv">
Page content
</div>
<div>
This should be the only text remaining.
</div>
</body>
</html>
Any suggestions?
Mike
[1] The message:
Error: uncaught exception: [Exception... "Illegal operation on
WrappedNative prototype object" nsresult: "0x8057000c
(NS_ERROR_XPC_B AD_OP_ON_WN_PRO TO)" location: "JS frame ::
file:///F:/Web/Blockquote/cite.js :: timerInstance_f ire :: line 103"
data: no]
--
Michael Winter
M.Winter@blueyo nder.co.invalid (replace ".invalid" with ".uk" to reply)
to calling the DOM method, Node.removeChil d(), using a reference to it
(long story...). That is, passing Node.removeChil d.
In Opera (7.23/Win), the call appears to do nothing - the node remains -
but no errors are shown. In Netscape (7.0/Win), an exception results[1].
On IE (6.0/Win), the node is removed.
Strangly, if I pass another function reference, say window.alert or a
user-defined function, there is no problem.
This illustrates the problem:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<title>Functi on reference test</title>
<script type="text/javascript">
function executeRef( func, arg ) {
func( arg );
}
function performRefTest( ) {
var elem = document.getEle mentById('testD iv');
executeRef( elem.parentNode .removeChild, elem );
}
</script>
</head>
<body onload="perform RefTest()">
<div id="testDiv">
Page content
</div>
<div>
This should be the only text remaining.
</div>
</body>
</html>
Any suggestions?
Mike
[1] The message:
Error: uncaught exception: [Exception... "Illegal operation on
WrappedNative prototype object" nsresult: "0x8057000c
(NS_ERROR_XPC_B AD_OP_ON_WN_PRO TO)" location: "JS frame ::
file:///F:/Web/Blockquote/cite.js :: timerInstance_f ire :: line 103"
data: no]
--
Michael Winter
M.Winter@blueyo nder.co.invalid (replace ".invalid" with ".uk" to reply)
Comment