When I visit the following webpage:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Test</title>
</head>
<body>
<div id="demo">this is a test...</div>
<script>
result = document.create Element("span") ;
result.style.co lor = "#f00";
result.style.fo ntWeight = "bold";
result.appendCh ild(document.cr eateTextNode(" ...that has been a
success"));
var demo = document.getEle mentById("demo" );
demo.parentNode .replaceChild(d emo,result);
</script>
</body>
I get this error (in FF2):
uncaught exception: [Exception... "Node was not found" code: "8"
nsresult: "0x80530008
(NS_ERROR_DOM_N OT_FOUND_ERR)" location:
"http://www.domain.tld/test.html Line: 17"]