I have an application that uses the DataTables jQuery library to render content in my target browser IE8. The problem is when I push a big array to be rendered, IE8 sometimes throws up the infamous long running script error.

After profiling the app it seems that the call to \_\_fnAddData in the following code is causing the problem:

```
if (bUsePassedData) {
  for (var i = 0, len = oInit.aaData.length; i < len; i++) {
      _fnAddData(oSettings, oInit.aaData[i]);
  }
} else if (oSettings.bDeferLoading ||
               (oSettings.sAjaxSource === null && oSettings.ajax === null)) {
  _fnAddTr(oSettings, $(oSettings.nTBody).children('tr'));
}

```

I was looking around for solutions and saw Nicholas Zakas' write up [here](http://www.nczonline.net/blog/2009/01/13/speed-up-your-javascript-part-1/) and tons of other solutions that would work if the for loop wasn't inside of an if else if "block". When I tried, on my 1st attempt of many, to wrap it in a setTimeout function it of course didn't work because the 2nd part of the if else if resolves to true.

```
(oSettings.sAjaxSource === null && oSettings.ajax === null) // true

```

What is a good solution for this? Thanks in advance.