Fwd: A question about Javascript and DOM support in Lonqueror

David Faure faure at kde.org
Thu Sep 8 17:12:03 BST 2005



----------  Forwarded Message  ----------

Subject: A question about Javascript and DOM support in Lonqueror
Date: Thursday 08 September 2005 15:59
From: David Goodenough <david.goodenough at btconnect.com>
To: David Faure <faure at kde.org>

David,

Sorry to bother you, and if you can think of someone better to answer this 
question please let me know who to send it to.

I am trying to write some code using AJAX, so I am exercising the DOM 
functions in Konqueror.  I am also using Firefox.

When I create an XML document to send off using XmlHttpRequest I use
code of the form:-

		var request = Sarissa.getDomDocument( );
		var membership = request.createElement( 'Membership'); 
		request.appendChild( membership);

and this works quite happily with Firefox.  When I try it with Konqueror 
it blows out with a DOM Exception 3 on the appendChild.

Looking at the W3c documents it seems that a Document object should
support everything that a Node supports, which should include appendChild.
appendChild is obviously there, but seems to refuse to append this as the root
element.

The Sarissa.getDomDocument code does:-

Sarissa.getDomDocument = function ( ) {
    return oDoc = document.implementation.createDocument( "", "", null);
    }

in this case.

So my real question is, how am I supposed to create a DOM document and
then add the root document to it?  And as a supplimentary if I am doing the 
right thing, is Firefox being kind or is Konqueror (and I have tried this
with 3.3.2 and 3.4.2) getting it wrong?

Thanks in advance

David



-------------------------------------------------------

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).




More information about the kfm-devel mailing list