Tengo un botón en mi página de inicio que exporta los datos tabulares que se muestran en la página. Hoy agregué algunos valores en la tabla y el botón de exportar dejó de funcionar. Ya no descarga los datos como archivo .csv. Todos los datos de mi aplicación web se almacenan en la base de datos mysql. A continuación se muestra el código que utilicé para exportar.
function fnExcelReport() { var tab_text = "<table border='2px'>"; var textRange; var j = 0; tab = document.getElementById('archive'); // id of table for (j = 0; j < tab.rows.length; j++) { if (tab.rows[j].style.display == "none") { continue; } 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, "");//remove if u want links in your table tab_text = tab_text.replace(/<img[^>]*>/gi, ""); // remove if u want images in your table tab_text = tab_text.replace(/<input[^>]*>|<\/input>/gi, ""); // reomves input params var ua = window.navigator.userAgent; var msie = ua.indexOf("MSIE "); if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) // If Internet Explorer { txtArea1.document.open("txt/html", "replace"); txtArea1.document.write(tab_text); txtArea1.document.close(); txtArea1.focus(); sa = txtArea1.document.execCommand("SaveAs", true, "Say Thanks to Summit.xls"); } else //other browser not tested on IE 11 sa = window.open('data:application/vnd.ms-excel,' + encodeURIComponent(tab_text)); return (sa);Intenté eliminar elementos en la base de datos, pero después de alcanzar cierta cantidad e ingresar un nuevo elemento, la exportación deja de funcionar. Cuando hago clic en el botón exportar, se abre una nueva pestaña y la URL dice: en blanco # bloqueado, por favor ayuda.