title: Are there performance benefits in storing HTML in javascript?
body: <p>We are using an Oracle product with a built-in form designer. This form designer allows the user to create a form definition, basically a collection of sections with sections containing lines. This generates a schema which is then converted using XSLT into HTML.</p>
  
  <p>Recently Oracle changed this XSLT to so that the HTML for each section is stored in javascript arrays so that it can be hidden/shown.</p>
  
  <p>Example:</p>
  
  <pre><code> section_html['registrationDetails'] = 
  
      '&lt;table role="presentation" oraMdLabel="EMPTY_SUMMARY" width="100%"&gt;'+ 
          '&lt;tbody name="nonRepeatingSchedule"&gt;'+  
              '&lt;tr&gt;'+
                  '&lt;td&gt;'+ 
                     '&lt;div c1GroupType="schedule" name="addDeleteControls" nowrap&gt;'+ 
                          '&lt;table role="presentation" oraMdLabel="EMPTY_SUMMARY"&gt;'+
                              '&lt;tr&gt;'+
                                  '&lt;td class="oraSectionHeader" width="100%"&gt;'+
  
                                      '&lt;span tabIndex="5" name="nonRepeatingHeader" oraMdLabel="CM_REG_DETAILS_LBL"&gt;&lt;/span&gt;'+
                                  '&lt;/td&gt;'+
                                  '&lt;td class="oraSectionHeader"&gt;'+
                                     '&lt;img tabIndex="5" src="images/collapse.gif" onkeypress="toggleHeaderDivInc(this, '+'registrationDetailsHeader'+');" onclick="toggleHeaderDivInc(this, '+'registrationDetailsHeader'+');" width="10" height="9" oraMdLabel="C1_FORM_HEADER_COLLAPSE" id="mainInfoImg"&gt;'+
                                  '&lt;/td&gt;'+
                              '&lt;/tr&gt;'+
                          '&lt;/table&gt;'+
                     '&lt;/div&gt;'+
                 '&lt;/td&gt;'+
              '&lt;/tr&gt;'+
  </code></pre>
  
  <p>This makes it difficult to read, edit and customize! Hiding and showing sections are not really difficult otherwise.</p>
  
  <p>Forms tend to have anything from between 30 to 200 lines with maybe 15 sections max.</p>
  
  <p>Are there real performance advantages to doing it this way? Or is there a better way of doing this?</p>