Closed Bug 1217 Opened 26 years ago Closed 26 years ago

Element.replaceChild(old,new); doesn't work

Categories

(Core :: DOM: Core & HTML, defect, P2)

x86
Windows 95
defect

Tracking

()

VERIFIED INVALID

People

(Reporter: angus, Assigned: vidur)

References

Details

Here's my test case: <html> <head> <title>replaceChild Test</title> <script> function setStatus(newText) { var status = document.getElementById('status'); var newStatusMessage = document.createTextNode(newText); status.replaceChild(status.firstChild, newStatusMessage); } </script> </head> <body onload="setStatus('done loading.');"> <span id="status">Initializing Test . . . .</span> </span> </body> </html>
Status: NEW → ASSIGNED
Setting all current Open/Normal to M4.
per leger, assigning QA contacts to all open bugs without QA contacts according to list at http://bugzilla.mozilla.org/describecomponents.cgi?product=Browser
Status: ASSIGNED → RESOLVED
Closed: 26 years ago
Resolution: --- → INVALID
The parameters to replaceChild are in the wrong order. If you change it to: status.replaceChild(newStatusMessage, status.firstChild) things should work fine. Of course, it would be nice if we displayed an error message. Unfortunately, the DOM spec says that this should fail silently.
Status: RESOLVED → VERIFIED
Marking Verified/Invalid
Depends on: SM240-RELNOTE
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.