J
John L.
I'd like to access a copy of a portion of my HTML document from
JavaScript contained within the HTML. I thought this would work:
var myHeader = ((Node)
(document.getElementById("header"))).cloneNode(true);
with the following HTML contained in the BODY section:
<DIV id="header">
o o o (various HTML statements)
</DIV>
However, I receive this error with Internet Explorer attempting to
view the HTML page:
Object Expected
The Opera browser was a little more helpful.It reported:
Error:
Unhandled exception: [Object DOMException]
code: 9
message: NOT_SUPPORTED_ERR
I suspect it is casting the Element as a Node that is failing, as the
Element interface extends the Node interface. How can I accomplish the
same functionality?
Thanks in advance for any help you may be able to provide.
John L.
JavaScript contained within the HTML. I thought this would work:
var myHeader = ((Node)
(document.getElementById("header"))).cloneNode(true);
with the following HTML contained in the BODY section:
<DIV id="header">
o o o (various HTML statements)
</DIV>
However, I receive this error with Internet Explorer attempting to
view the HTML page:
Object Expected
The Opera browser was a little more helpful.It reported:
Error:
Unhandled exception: [Object DOMException]
code: 9
message: NOT_SUPPORTED_ERR
I suspect it is casting the Element as a Node that is failing, as the
Element interface extends the Node interface. How can I accomplish the
same functionality?
Thanks in advance for any help you may be able to provide.
John L.