Note that there are some explanatory texts on larger screens.

plurals
  1. POJavascript and VERY LONG string
    text
    copied!<p>i am having problems with the below code:</p> <pre><code>function showTableData() { var tableArray; var x = 0; var theHTML; for (i = 0; i &lt; 7032; i++) { if (x = 0) { theHTML = '&lt;tr&gt;' + '&lt;th scope="row" class="spec"&gt;' + partNum[i] + '&lt;/th&gt;' + '&lt;td&gt;' + Msrp[i] + '&lt;/td&gt;' + '&lt;td&gt;' + blah[i] + '&lt;/td&gt;' + '&lt;td&gt;' + blahs[i] + '&lt;/td&gt;' + '&lt;/tr&gt;' + theHTML; x++; }else{ theHTML = '&lt;tr&gt;' + '&lt;th scope="row" class="specalt"&gt;' + partNum[i] + '&lt;/th&gt;' + '&lt;td class="alt"&gt;' + Msrp[i] + '&lt;/td&gt;' + '&lt;td class="alt"&gt;' + blah[i] + '&lt;/td&gt;' + '&lt;td class="alt"&gt;' + blahs[i] + '&lt;/td&gt;' + '&lt;/tr&gt;' + theHTML; x--; } } theHTML = '&lt;table id="mytable" cellspacing="0"&gt;' + '&lt;tr&gt;' + '&lt;th scope="col" abbr="Configurations" class="nobg"&gt;Part Number&lt;/th&gt;' + '&lt;th scope="col" abbr="Dual 1.8"&gt;Msrp Price&lt;/th&gt;' + '&lt;th scope="col" abbr="Dual 2"&gt;blahs Price&lt;/th&gt;' + '&lt;th scope="col" abbr="Dual 2.5"&gt;Low Price&lt;/th&gt;' + '&lt;/tr&gt;' + theHTML + '&lt;/table&gt;'; $('#example').append(theHTML); } &lt;/script&gt; &lt;div id="example"&gt; &lt;/div&gt; </code></pre> <p>The problem being that the <b>$('#example').append(theHTML);</b> never executes (or shows on the page). I think its because the string is soooooo long! It has over 7,000 items in the array so im not sure if thats the reason or if its something else?</p> <p>Any help would be great! Thanks!</p> <p>David</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload