Hello all,
Maybe there is a better place to post this, but I'm not sure where.
I am writing a Web application. Using a pop-up for printing a portion of the
parent window, from an imbedded javascript function, I am using outerHTML to
grab that markup and then place it in the markup of the page displaying in
the pop-up.
Here is the script...
function setMyContent()
{
var theBody =
window.opener.document.getElementById("cardContent").outerHTML;
var theDivTag = document.getElementById("theCard");
theDivTag.innerHTML = theBody;
}
</script>
This all works fine in IE6 and IE7, but I am getting "undefined" returned in
Firefox.
Anyone know?
Thanks to all...
Alexey Smirnov - 27 Jun 2007 15:15 GMT
On Jun 27, 3:38 pm, "John Kotuby"
<JohnKot...@discussions.microsoft.com> wrote:
> Hello all,
>
[quoted text clipped - 20 lines]
>
> Thanks to all...
try to use this function
function getOuterHTML(object) {
var element;
if (!object) return null;
element = document.createElement("div");
element.appendChild(object.cloneNode(true));
return element.innerHTML;
}
John Kotuby - 27 Jun 2007 16:38 GMT
Thanks Alexey...
> On Jun 27, 3:38 pm, "John Kotuby"
> <JohnKot...@discussions.microsoft.com> wrote:
[quoted text clipped - 36 lines]
> return element.innerHTML;
> }
Mark Rae - 27 Jun 2007 16:40 GMT
> I am using outerHTML
According to Danny Goodman's "Dynamic HTML - The Definitive Reference",
outerHTML is supported in IE 4 and above, Safari 1.3 and above, and Opera 7
and above.
It is not supported in Netscape or Mozilla (i.e. FireFox)...

Signature
http://www.markrae.net
bruce barker - 27 Jun 2007 16:41 GMT
outerHTML is not a valid W3C dom property so is not supported by
firefox. firefox does support innerHTML even though its not a standard.
you should be using W3C properties like nodeValue (for innerHTML). you
can use the document.createNode() to clone the outernode (be sure to
copy attributes)
-- bruce (sqlwork.com)
> Hello all,
>
[quoted text clipped - 20 lines]
>
> Thanks to all...