I have an ASP.NET MVC page that has JQuery Editable Datatable that has 14 columns. I have a button (Apply No Findings)to do Client side calcultions snd apply for all Rows in that table.
When we click on this button, after applying calculations for every 4 Rows, it is displaying this "Stop Running Script" Message.
I verified the settings. In the Internet Options, Advanced tab, "Disable Script debugging(Internet Explorer)" option is Checked. And "Display a Notification about Script Error" is Unchecked.
I am using Internet Explorer 8. I Now it does not happen on IE9. But this being the server, we cannot upgrade to IE9.
I did the Research and tried these two options and nothing worked.
Example(1): http://www.codeproject.com/Tips/406739/Preventing-Stop-running-this-script-in-Browsers
Anyone had this isse and any suggestions are highly appreciated.
This is actual code that is throwing the Script Message:
for(i < iTotalRecords;i++)
{
var row = oTableAuditLines.fnGetData(i);
oTableAuditLines.fnUpdate("NF",i,1);
UndoHCPCS(row,i);
UndoHCPCSModCodes(row,i);
UndoLineUnitCount(row,i);
oTableAuditLines.fnUpdate("", i, 6); //Reset Denial Reason Code
UndoNonCoveredCharges(row,i);
CalculateAmountPaidAtLine(row,i);
CalculateEstimatedRecoveryAmountAtLine(row,i);
}
UpdateSummaryLine();
UpdateSummaryLineReasonCode();
By referring sample code in Example(2), I changed the code as below and I am still getting the Script message:
//This function is to avoid Script Running Message
RepeatingOperation = function(op, yieldEveryIteration)
{
var count = 0;
var instance = this;
this.step = function(args)
{
if (++count >= yieldEveryIteration)
{
count = 0;
setTimeout(function() { op(args); }, 1, [])
return;
}
op(args);
};
};
function ApplyNoFindings()
{
var i = 0;
var ro = new RepeatingOperation(function()
{
var row = oTableAuditLines.fnGetData(i);
oTableAuditLines.fnUpdate("NF",i,1);
UndoHCPCS(row,i);
UndoHCPCSModCodes(row,i);
UndoLineUnitCount(row,i);
oTableAuditLines.fnUpdate("", i, 6); //Reset Denial Reason Code
UndoNonCoveredCharges(row,i);
CalculateAmountPaidAtLine(row,i);
CalculateEstimatedRecoveryAmountAtLine(row,i);
if (++i < iTotalRecords)
{
ro.step();
}
else
{
UpdateSummaryLine();
UpdateSummaryLineReasonCode();
}
}, 100);
ro.step();
}
What am i doing wrong here?