I am using jQuery with the DataTable plugin and now I have a big performance problem on the next line.
aLocalData[jInner] = nTds[j].innerHTML; // jquery.dataTables.js:2220
I have an ajax call and an HTML formatted result string. I convert them to HTML nodes and this part is fine.
var $result = $('<div/>').html(result).find("*:first"); // simlar to $result=$(result) but much more faster in Fx
Then I activate the inclusion of the result from a simple table in a sortable datatable. Speed ββis acceptable in Fx (about 4 seconds for 900 lines), but not acceptable in IE8 (more than 100 seconds).
I test it using the buildin profiler and find that the above single line takes 99.9% of the time, how can I speed it up? what did I miss?
nTrs = oSettings.nTable.getElementsByTagName('tbody')[0].childNodes; for ( i=0, iLen=nTrs.length ; i<iLen ; i++ ) { if ( nTrs[i].nodeName == "TR" ) { iThisIndex = oSettings.aoData.length; oSettings.aoData.push( { "nTr": nTrs[i], "_iId": oSettings.iNextId++, "_aData": [], "_anHidden": [], "_sRowStripe": '' } ); oSettings.aiDisplayMaster.push( iThisIndex ); aLocalData = oSettings.aoData[iThisIndex]._aData; nTds = nTrs[i].childNodes; jInner = 0; for ( j=0, jLen=nTds.length ; j<jLen ; j++ ) { if ( nTds[j].nodeName == "TD" ) { aLocalData[jInner] = nTds[j].innerHTML;
performance jquery internet-explorer-8 innerhtml
Dennis c
source share