I’ve been workin today on Live Search for this web site. It uses Ajax and since this site is made in real XHTML, JavaScript works in xml mode.
When you work with JavaScript in real XHTML sites sometimes things are different than what they used to be. For example, you make an Ajax call and got transport.responseXML object. This is what you do to add that xml to your code.
var content = $('content')
var res_xml = document.importNode(transport.responseXML.documentElement, true)
content.parentNode.replaceChild(res_xml, content)
You can’t just take plain transport.responseXML object and use replaceChild or appendChild methods on it. You need to call importNode or adoptNode first, to import it to the current document, only after that you can use replaceChild or appendChild.
It took me 2 hours to figure that out, because Safari doesn’t show any error message when you don’t use importNode, it just doesn’t work. And in Firefox it works, but without any error message or a warning, which makes it very difficult to find the error.