Hello all,
I'm using AJAX to repopulate a <tbody>. The data is returned in JSON format and the DOM is generated by some JavaScript. Sound straight forward, and it works fine in Firefox, but in IE it causes an error:
Has anyone encountered this? Or see something I'm missing in my code?The instruction at "hex memory address" referenced memory at "hex memory address". The memory could not be read.
Thanks,
Ben
Code:function buildContactList(originalRequest) { var NUMBER_OF_CELLS = 5; var tbody; var row; var programRow; var cell; document.getElementById("pocs").removeChild(document.getElementById("resultsBody")); tbody = document.createElement("<tbody id='resultsBody'>"); document.getElementById("pocs").appendChild(tbody); var response = eval("(" + originalRequest.responseText + ")"); var length = response.length; if(length == 0) { row = document.createElement("<tr>"); tbody.appendChild(row); cell = document.createElement("<td>"); row.appendChild(cell); cell.colSpan = NUMBER_OF_CELLS; cell.innerHTML = "No data found for the given search criteria, please change the search criteria and try again."; cell = null; row = null; return; } for(var i = 0; i < length; i++) { programRow = document.createElement("<tr id='row" + i + "'>"); tbody.appendChild(programRow); for(var j = 0; j < NUMBER_OF_CELLS; j++) { cell = document.createElement("<td>"); programRow.appendChild(cell); cell.innerHTML = response[i][j]; if(j == 0) cell.style.textAlign = "left"; cell = null; } programRow = null; } tbody = null; }


Reply With Quote

Bookmarks