Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how to get innerHTML off of a document in Netscape 6.01

0 views
Skip to first unread message

Thad Hoffman

unread,
Jun 14, 2001, 11:13:01 AM6/14/01
to
I have created an xml document using the createDocument() method. Since the
XMLSerializer isn't available in
Netscape 6.01, I am trying to get the innerHTML of the document I created. I
have read that innerHTML is available off of
x.documentElement.innerHTML, and that it works in Netscape 6, however I keep
getting "undefined".

Any hints as to how one might be able to grab the innerHTML out of the
document in order to send it to a server for processing
?

Thanks,
Thad


b_driesen

unread,
Jun 17, 2001, 7:44:03 AM6/17/01
to
<xmp>
<!--for html view -->

<html>
<script> window.onload = CheckIt;
function CheckIt() {
var oDoc = document.getElementById("CheckIt");
if (oDoc) alert(oDoc.innerHTML);
}
</script>
<body>
<span id="CheckIt">Help <b>meee</b></span>
</body>
</html>

<!--end of xmp tag-->
</xmp>

"Thad Hoffman" <thad.h...@gogallagher.com> wrote in message news:9gaka0$ab...@secnews.netscape.com...

Jiri Znamenacek

unread,
Jun 17, 2001, 4:59:46 PM6/17/01
to
Isn't innerHTML supposed to work only on HTML (and not XML) documents?
Jirka

Jeff Yates

unread,
Jun 17, 2001, 11:58:18 AM6/17/01
to
Correct,

InnerHTML is a property of HTML documents only. You could use my javascript
range patch to get the xml markup of the document (the propertly is xml).
The problem though is that Mozilla has created a bug after 0.9 (and is still
in 0.9.1) that does not expose the prototype of DOM objects, nor many of the
constructor objects. If you want to try the patch goto:
http://www.pbwizard.com/Articles/Moz_Range_Object_Article.htm

If you follow the code for where I add the xml property (same as M$ XML
document's xml property) then you will find that you can modify the code to
get the xml.

Jeff Yates
http://www.pbwizard.com


"Jiri Znamenacek" <pi...@kolej.mff.cuni.cz> wrote in message
news:3B2D1A42...@kolej.mff.cuni.cz...

Thad Hoffman

unread,
Jun 18, 2001, 11:29:51 AM6/18/01
to
Jeff,

Thanks for the info and the link.

A little background to my inquiry:

I am attempting to implement a web application in Netscape 6.x/Mozilla
comparable to IE 5.5's abililties.
Without using the MSXMLDOM ActiveXObject, I can build an XML element that
IS an HTML element. I can
add to and edit the nodes then just grab the innerHTML of the xml element
and ship it off to the server. Then have the server
return a new node (aka innerHTML) to the xml element for the client to
interact with.

I went this route in hopes that Netscape/Mozilla would behave similarly.
Since there currently isn't an MSXMLDOM-like feature completely
implemented yet. I wanted to avoid having to fork everything.

But Netscape/Mozilla won't allow the document.createElement('xml') to work,
let alone any other non html 4 tag. Making it
difficult to work with XHTML.

I can use the document.implementation.createDocument() which is great, but
in Netscape 6.01, there is know built in way to serialize that xml
into a string so I can send it into the server (all via soap and http),
which is why I was trying to get the innerHTML to work. I can make the XML,
but
can't seem to get it back out.

Thad

"Jeff Yates" <pb...@pbwizard.com> wrote in message
news:9gikc1$89...@secnews.netscape.com...

Jeff Yates

unread,
Jun 18, 2001, 12:35:01 PM6/18/01
to
Thad,

You are wanting to be able to communicate to the server with XML, then you
need to use Nescape 6.1 (currently released in Preview Release 1). It
supports the XMLHTTPRequest object. It is the first Netscape to offer it.
Mozilla has offered it since 0.8.1, and IE from 5.0. See:
http://unstable.elemental.com/mozilla/build/latest/mozilla/extensions/dox/cl
ass_nsIXMLHttpRequest.html

For just downloading I have a binding/behavior pair that adds this
functionality for text and xml documents. See:
http://www.pbwizard.com/Articles/DownloadDoc.htm

Hope this helps.

Jeff Yates.
http://www.pbwizard.com


"Thad Hoffman" <thad.h...@gogallagher.com> wrote in message

news:9gl6pg$i5...@secnews.netscape.com...

Thad Hoffman

unread,
Jun 19, 2001, 10:25:51 AM6/19/01
to
Jeff,

Thanks again for the info. I was planning on using the XMLHTTPRequest
object, I have played with it in Mozilla and IE, and I am glad
is has made it into the Netscape version, as we have to use Netscape as our
browser (well I.E. 5.5 and Netscape 6 are the
system requirements we were given).

Do you know, off hand, if the XMLSerializer has been implemented in 6.1 as
well? That is the piece I really need. We have been using a Java Applet to
handle the http request until it got rolled into a Netscape release, but I
need a way to get the xml document into a string...

Thanks for all your help.

Thad

"Jeff Yates" <pb...@pbwizard.com> wrote in message

news:9glauc$ia...@secnews.netscape.com...

Heikki Toivonen

unread,
Jun 19, 2001, 1:37:18 PM6/19/01
to
Yes, XMLSerializer is there. But please keep in mind that it is
deprecated (will hopefully be replaced with DOM Level 3 Load & Save once
it becomes a recommendation).

Thad Hoffman wrote:

> Do you know, off hand, if the XMLSerializer has been implemented in 6.1 as
> well? That is the piece I really need. We have been using a Java Applet to
> handle the http request until it got rolled into a Netscape release, but I
> need a way to get the xml document into a string...

--
Heikki Toivonen

Myk Melez

unread,
Jun 19, 2001, 2:36:07 PM6/19/01
to Heikki Toivonen
Heikki,

Is there a bug in Bugzilla for DOM Level 3 Load & Save?

-myk

0 new messages