These 2 lines are getting me:
It doesn't appear on screen, but then the alert says what I want it to say.Code:frame.contentDocument.getElementsByTagName ("html") [0].innerHTML = theXML; alert (frame.contentDocument.getElementsByTagName ("html") [0].innerHTML);
The entire code is:
I did it before with it writing about:blank, but right now I can't figure out whats wrong.Code:<html> <head> <script type="text/javascript"> window.onload = function () { for (var i = 0; i < document.getElementsByTagName ("xml").length; i = i + 1) { var tag = document.getElementsByTagName ("xml") [i]; var theXML = "<?" + tag.getAttribute ("doctype") + "?>" + tag.innerHTML; tag.innerHTML = ""; var frame = document.createElement ("iframe"); frame.setAttribute ("src","about:blank"); tag.appendChild (frame); frame.contentDocument.getElementsByTagName ("html") [0].innerHTML = theXML; alert (frame.contentDocument.getElementsByTagName ("html") [0].innerHTML); } } </script> </head> <body> <xml doctype='version="1.0" encoding="ISO-8859-1"'> <root> hahaha </root> </xml> </body> </html>



Reply With Quote

Bookmarks