Skip to main content

Posts

Showing posts from November, 2008

Converting Javascript XML Object to String

I recently ran through a problem of XMLSerializer object. This is not working with IE. Fortunately IE support this simple method to convert an XML Objet to a String."XMLObject.xml". The following function will convert an XML Object in both browsers. function xmlToString(xmlObj) { if (navigator.appName == "Netscape") { return (new XMLSerializer()).serializeToString(xmlObj); } if (navigator.appName == "Microsoft Internet Explorer") { return xmlObj.xml; } }