title: IE11: setting innerHtml does not set firstChild
body: <p>I have a curious problem where a simple JSF page does not work under IE11. It works as expected under Firefox and Chrome but IE11 gives 'malformedXML: Illegal argument'.</p>
  
  <p>Investigation with a debugger shows that the AJAX response from clicking on a radio button is being considered invalid by IE11 inside jsf.js.</p>
  
  <p>The actual result is that Element.firstChild is set to null which I am assuming indicates that innerHtml content is not considered to be valid html. This happens on a) An Ajax response, and b) not on Firefox or Chrome</p>
  
  <p>The relevant code in jsf.js is:</p>
  
  <p>Line 1472: jsf.js version 2.2</p>
  
  <pre><code>         if (html.length &gt; 0) {
                  if (isAutoExec()) {
                      // Create html
                      parserElement.innerHTML = html;
                  } else {
                      // Get the scripts from the text
                      scripts = stripScripts(html);
                      // Remove scripts from text
                      html = html.replace(/&lt;script[^&gt;]*type="text\/javascript"*&gt;([\S\s]*?)&lt;\/script&gt;/igm,"");
                      parserElement.innerHTML = html;
                  }
                 replaceNode (parserElement.firstChild, d);
  </code></pre>
  
  <p>The AJAX response is:</p>
  
  <pre><code> &lt;?xml version='1.0' encoding='UTF-8'?&gt;
  &lt;partial-response id="j_id1"&gt;
      &lt;changes&gt;
          &lt;update id="payment:paymentgroup"&gt;&lt;![CDATA[&lt;span id="payment:paymentgroup"&gt;Enter &lt;span id="payment:onaccount"&gt;Account&lt;/span&gt;&lt;/span&gt;]]&gt;&lt;/update&gt;
          &lt;update id="j_id1:javax.faces.ViewState:0"&gt;&lt;![CDATA[-2818987988265526344:7981698299886652187]]&gt;&lt;/update&gt;
          &lt;extension id="org.richfaces.extension"&gt;
              &lt;render&gt;payment:paymentgroup&lt;/render&gt;
          &lt;/extension&gt;
      &lt;/changes&gt;
  &lt;/partial-response&gt;
  </code></pre>
  
  <p>In the code above 'html' is set to:</p>
  
  <pre><code>&lt;span id="payment:paymentgroup"&gt;Enter &lt;span id="payment:onaccount"&gt;Account&lt;/span&gt;&lt;/span&gt;
  </code></pre>
  
  <p>the result of 'parserElement.innerHTML = html' is that 'parserElement.firstChild' is left null giving rise to an exception in 'replaceNode (parserElement.firstChild, d)'</p>
  
  <p>I have tried this html in a simple page containing similar javascript and it works. Presumably something in the environment/context is affecting it.</p>
  
  <p>I would appreciate any guidance/advice how to solve or workaround this issue.</p>
  
  <p>You can see the jsf code I am using below. A link to running code is</p>
  
  <p><a href="http://testshop.actionfarm.co.uk/actjsf/" rel="nofollow">http://testshop.actionfarm.co.uk/actjsf/</a></p>
  
  <p>I am using java 8.0.45, jboss 9.CR1 with Mojarra 2.2.10. I am also using Richfaces 4.5.4 although this is just JSF components.
  (I was using jboss 8.2 but upgraded to see if it made a difference with a later Mojarra)</p>