Charlie. Posted May 5, 2006 Share Posted May 5, 2006 Consider the following:I have a PHP script on the server that generates an HTML form. It wraps it in XML, like so:<xhtml> <form... ... </form> ...</xhtml>This is done because, strictly speaking, XML documents should only have one root node and my application's design states that this script will return well-formed XML. There may be more than just a form element in the response.I have a javascript function that uses Ajax to GET this. The code that fetches it is nothing special. Once it returns, I have a response object with two properties: responseText and responseXML. Looking at responseText shows that the Ajax code works perfectly and does get the correct XML back. Using getElementsByTagName('xhtml'), I can get the xhtml element successfully. Now, I want to insert ALL the HTML within that element into a conveniently prepared DIV element on my page. How do I do this?I know that IE would allow me to set the "innerHTML" property of my DIV to the "xml" property of my xhtml node, but the "xml" property is not supported by other browsers, so that does not help. (My reference browser is Firefox, BTW)Please help! Quote Link to comment https://forums.phpfreaks.com/topic/9110-ajax-html-in-responsexml-dynamic-html-content/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.