Microsoft KB Archive/298974

= BUG: Internet Explorer Stops Responding When You Dynamically Insert Table That Contains  =

Article ID: 298974

Article Last Modified on 5/11/2006

-

APPLIES TO


 * Microsoft Internet Explorer 5.5
 * Microsoft Internet Explorer (Programming) 6.0

-



This article was previously published under Q298974



SYMPTOMS
Internet Explorer generates an access violation and stops responding (crashes) when you dynamically insert a table that contains the following



into a Web page by updating the innerHTML of a div.



CAUSE
This behavior can occur if a mouse event is pending and you wipe out the control that initiated the mouse event before the mouse event returns.



Workaround 1
Instead of redrawing the entire table every time, insert a single row at a time into the existing table. To do this, use the insertRow and insertCell methods.

Workaround 2
Replace



with the following tag:



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.



MORE INFORMATION
The following is a sample page that quits or stops responding: var aRecords = new Array; function Record( sText) {       this.Text = String(sText); }

function displayRecord {       var sDisp = ' '; document.getElementById(&quot;divRecord&quot;).innerHTML = sDisp; }

function addNewRecord {       var i;        for( i=0; i  Workaround 1 applied: var aRecords = new Array; function Record( sText) {        this.Text = String(sText); }

function displayRecord {        var sDisp=&quot;&quot;; var i,sRow,sCol; if(window.event.srcElement.id==&quot;button1&quot;) {       i=aRecords.length-1; sDisp += aRecords[i].Text sRow=table1.insertRow; sCol=sRow.insertCell; sCol.innerText=aRecords[i].Text; }  }

function addNewRecord {        var i;         for( i=0; i

Workaround 2 applied:

Replace the following line in displayRecord function of the sample page:  with: New

