This code is working fine for 5000 rows in chrome but when table exceed it's size more than 5000. Nothing is exported only in new tab shows #blocked
$("#exportDiv").click(function () {
var tab_text = "<table border='2px'><tr bgcolor='#87afc6'>";
var textrange; var j = 0;
tab = document.getelementbyid('reporttable'); // id of table
for (j = 0; j < tab.rows.length; j++) {
tab_text = tab_text + tab.rows[j].innerhtml + "</tr>";
//tab_text=tab_text+"</tr>";
}
tab_text = tab_text + "</table>";
tab_text = tab_text.replace(/<a[^>]*>|<\/a>/g, "");
tab_text = tab_text.replace(/<img[^>]*>/gi, "");
tab_text = tab_text.replace(/<input[^>]*>|<\/input>/gi, "");
var ua = window.navigator.useragent;
var msie = ua.indexof("msie ");
if (msie > 0 || !!navigator.useragent.match(/trident.*rv\:11\./))
{
txtarea1.document.open("txt/html", "replace");
txtarea1.document.write(tab_text);
txtarea1.document.close();
txtarea1.focus();
sa = txtarea1.document.execcommand("saveas", true, "report.xls");
}
else //other browser not tested on ie 11
sa = window.open('data:application/vnd.ms-excel,' + encodeuricomponent(tab_text));
return (sa);
});