Im trying to implement a Javascript in tandem with swfObject that passes the HTML that gets replaced to flash, and then flash is gonna parse it as XML (seeing as well-formed XHTML is XML anyway) so i was using var sourceXMLVar = document.getElementById("wines").parentNode.innerHTML; sourceXMLVar = sourceXMLVar.replace(/"/g, "'"); Code (markup): and it works fine in Firefox. i had to strip out the double-quotes but once i pass the vars to flash and parse it as XML it works perfectly. but for some reason when i get the innerHTML in IE 6 or 7 - its all messed up. for instance, all the tag names are capitilised, and all the attributes except for href dont have any double-quotes (eg, <div class="test"> gets turned into <DIV class=test> ) so after lots of reading about UA's, tag soup, xhtml with text/html mime types and so forth, im totally stumped... is it possible in both IE and Firefox (or preferably as many browsers as possible), to use javascript to create a string that contains all the html contained in a specific element, say a div?
i just attempted to remedy the problem by converting my document to HTML 4.0.1 strict, hoping that the IE tag soup rendering of XHTML was causing the issue, but to no avail in fact, this code document.getElementById("wines").innerHTML = '<p class="test">test</p>'; alert(document.getElementById("wines").innerHTML); Code (markup): returns <P class=test>test</P> for some ridiculous reason, only in IE though why on earth is IE intent on stripping out quotes of attributes and capitalising every tag name? and more importantly - how can i get around this stupid behaviour?