Note that there are some explanatory texts on larger screens.

plurals
  1. POIE9 Javascript generated table
    primarykey
    data
    text
    <p>Hi I have a problem only in IE9</p> <p>I have a Javascript loop the generates a table first</p> <pre><code> var TABLE = widget.body.getElementsByClassName('classroom')[0]; var TBODY = widget.createElement('tbody'); //generate rows &amp; Cells, 10 x 10 var cID = 0; for (var r=0; r&lt;10; r++) { var TR = widget.createElement('tr'); for (var c=0; c&lt;10; c++) { var TD = widget.createElement('td'); //TD.id="c"+cID; TD.setAttribute("class",'c'+cID); TD.setAttribute("id",'c'+cID); TD.setAttribute("style","width:90px;"); TD.setAttribute("style","height:90px;"); cID++; TR.appendChild(TD); } TBODY.appendChild(TR); } TABLE.appendChild(TBODY); </code></pre> <p>Which works fine</p> <p>it's then calls this another function to populate the table.</p> <p>this is just a snippet the functions huge!</p> <pre><code>var cell_class = cell.toString(); // it gets the cell from another loop say 'c1' var TCell = widget.body.getElementsByClassName(cell_class)[0]; TCell.innerHTML="&lt;a href='#'&gt;image&lt;/a&gt;"; // it fails at this point 'null or undefined' </code></pre> <p>in the HTML I have</p> <pre><code>&lt;table id="table1" class="classroom"&gt; &lt;colgroup&gt; &lt;col width="90" height="70"/&gt; &lt;col width="90" height="70"/&gt; &lt;col width="90" height="70"/&gt; &lt;col width="90" height="70"/&gt; &lt;col width="90" height="70"/&gt; &lt;col width="90" height="70"/&gt; &lt;col width="90" height="70"/&gt; &lt;col width="90" height="70"/&gt; &lt;col width="90" height="70"/&gt; &lt;col width="90" height="70"/&gt; &lt;/colgroup&gt; &lt;/table&gt; </code></pre> <p>it works if I add a static table to the HTML but I want it dynamic.</p> <p>This works in all the current browsers apart from IE9</p> <p>Can anyone Help </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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