Datatables 1.9.4-- stop running script error on IE
Datatables 1.9.4-- stop running script error on IE
anandpatil343
Posts: 13Questions: 0Answers: 0
I am using version 1.9.4 in my application, user is constantly getting stop running the script error on IE (8,9 etc)...
I have used the IE profiler , I have the below results : (some of the functions)
Function Count InclusiveTime (ms) ExclusiveTime (ms) AvgTime MaxTime
JScript - window script block 44,905 50,248.39 41,951.78 1.12 19,733.74
Array.unshift 1,447,666 7,249.77 7,249.77 0.01 343.74
initDataTable 1 57,201.30 6,827.91 57,201.30 57,201.30
initCreatedLeadsDataTable 1 62,888.61 5,687.32 62,888.61 62,888.61
pt 44,904 1,046.84 1,046.84 0.02 218.74
browserHandler 7 62,997.98 93.75 8,999.71 62,888.61
Array.sort 1 50,295.27 46.87 50,295.27 50,295.27
DataTable 1 50,373.39 15.62 50,373.39 50,373.39
String.replace 42 15.62 15.62 0.37 15.62
I need to know what is this array.unshift , why is taking being called so much time.
Need your assistance to resolve this error.
I have used the IE profiler , I have the below results : (some of the functions)
Function Count InclusiveTime (ms) ExclusiveTime (ms) AvgTime MaxTime
JScript - window script block 44,905 50,248.39 41,951.78 1.12 19,733.74
Array.unshift 1,447,666 7,249.77 7,249.77 0.01 343.74
initDataTable 1 57,201.30 6,827.91 57,201.30 57,201.30
initCreatedLeadsDataTable 1 62,888.61 5,687.32 62,888.61 62,888.61
pt 44,904 1,046.84 1,046.84 0.02 218.74
browserHandler 7 62,997.98 93.75 8,999.71 62,888.61
Array.sort 1 50,295.27 46.87 50,295.27 50,295.27
DataTable 1 50,373.39 15.62 50,373.39 50,373.39
String.replace 42 15.62 15.62 0.37 15.62
I need to know what is this array.unshift , why is taking being called so much time.
Need your assistance to resolve this error.
This discussion has been closed.
Replies
Expecting some response on this, need your assistance.
In IE8, I get the pop up on the below line of code:
this.each(function () {
var i = 0, iLen, j, jLen, k, kLen;
var sId = this.getAttribute('id');
var bInitHandedOff = false;
var bUsePassedData = false;
/* Sanity check */
if (this.nodeName.toLowerCase() != 'table') {
_fnLog(null, 0, "Attempted to initialise DataTables on a node which is not a " +
"table: " + this.nodeName);
return;
}
I guess something to do with too much of looping.
2. Try using the latest version of DataTables (1.10.0-beta.3) which has some performance improvements.
Allan
Thanks for your reply (phewww.. :)..)
I am new to this portal, by test case you mean you need a link or something replicating the issue?.
Can I safely use the 1.10.0-beta.3 version on my prod environment?
Also, does this datatables.js require some particular version of jquery?
Waitin for your response!!.
/* Check to see if we are re-initialising a table */
for (i = 0, iLen = DataTable.settings.length; i < iLen; i++) {
/* Base check on table node */
if (DataTable.settings[i].nTable == this) {
if (oInit === undefined || oInit.bRetrieve) {
return DataTable.settings[i].oInstance;
}
else if (oInit.bDestroy) {
DataTable.settings[i].oInstance.fnDestroy();
break;
}
else {
_fnLog(DataTable.settings[i], 0, "Cannot reinitialise DataTable.\n\n" +
"To retrieve the DataTables object for this table, pass no arguments or see " +
"the docs for bRetrieve and bDestroy");
return;
}
}
/* If the element we are initialising has the same ID as a table which was previously
* initialised, but the table nodes don't match (from before) then we destroy the old
* instance by simply deleting it. This is under the assumption that the table has been
* destroyed by other methods. Anyone using non-id selectors will need to do this manually
*/
if (DataTable.settings[i].sTableId == this.id) {
DataTable.settings.splice(i, 1);
break;
}
}
One observation, I commented the below line in fndestroy method and things got working now.
/* Blitz all DT events */
//$(oSettings.nTableWrapper).find('*').andSelf().unbind('.DT');
I don't no what is the impact of commenting this line, need your inputs on this please..
Any thoughts on the above.
Please don't bump posts. I'm providing free support as much as possible here.
> I am new to this portal, by test case you mean you need a link or something replicating the issue?.
Yes - link to the page, or use JSFiddle or similar to replicate the problem. Without being able to reproduce the issue I am just guessing and wasting everybody's time.
> Can I safely use the 1.10.0-beta.3 version on my prod environment?
That is up to you to decide. I do - but only you can say for you use case.
> Also, does this datatables.js require some particular version of jquery?
1.7 or newer.
> //$(oSettings.nTableWrapper).find('*').andSelf().unbind('.DT');
That line of code is _very_ slow. I've altered it in 1.10 to be much faster.
Allan
I used the 1.10 beta version (on test environment), I see the speed has boosted up but have one problem.
The header columns are being shown twice due to which sorting is choking (I guess this is due to double headers) , any pointers on this would be helpful.
Awaiting your inputs...
Been a while, did you get a chance to look into this?