IE <= 8 removes <form> tag when received from AJAX

Viewed 2667

I'm making an AJAX POST call to get some HTML. I take that HTML and inject it into the DOM. Everything works fine and dandy in every browser except for IE <= 8. It seems like IE is parsing the incoming HTML since when I log it to console/alert it, tags are in capitals.

The line it's removing:

<form class="uniForm" enctype="multipart/form-data" action="/profile/editprofile/" method="post">

Very bizarre because the end tag is there but the start tag isn't. The call is a standard jQuery POST ($.post()).

UPDATE:

Ended up giving up and putting it into an embedded textarea and reinjecting into the DOM:

<!--[if lt IE 9]>
<textarea class="ieHackTextArea">
<!--[if lt IE 9]>
<![endif]-->

... somewhere else ...

if ($.browser.msie && parseFloat($.browser.version) < 9) {
    ui.panel.innerHTML = $(".ieHackTextArea").val(); // jQuery injection doesn't work
}
4 Answers
Related