I have a javascript page with e4x enabled.
I am trying to get all the XML displayed into a div object.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>My Data</title> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" > <script type="text/javascript"> function getInfo() { var xhr; try { xhr = new ActiveXObject('Msxml2.XMLHTTP'); } catch (e) { try { xhr = new ActiveXObject('Microsoft.XMLHTTP'); } catch (e2) { try { xhr = new XMLHttpRequest(); } catch (e3) { xhr = false; } } } xhr.open("POST", "http://mysite:4321/select/?p=1&q=2", true); xhr.onreadystatechange = function() { if(xhr.readyState == 4) { document.getElementById("ajax").innerHTML.value = xhr.responseText; } } xhr.send(null); } </script> </head> <body onLoad="getInfo();"> <div id="ajax"> </div> </body> </html>
I have tried e4x, but I'm still unsure how it works! i.e.
I have to add ";e4x" to the language type, but it seems to have issues with the declaration of getInfo.
I have googled around and can't seem to find anything which allows you to display the whole XML (only transfer data from specific elements).
Either, how do I get all the XML displayed on my page (in text format) in javascript (old style)?
Or, How do I do it in e4x? Is e4x worth embracing?
Ay guidance would be much appreciated.
Regards,
Gruntmonk