I am using the following codeto export html table using javascript.
$(document).ready(function() {
$("#btnExport").click(function(e) {
e.preventDefault();
//getting data from our table
var data_type = 'data:application/vnd.ms-excel';
var table_div = document.getElementById('history');
var table_html = table_div.outerHTML.replace(/ /g, '%20');
var a = document.createElement('a');
document.body.appendChild(a);
a.href = data_type + ', ' + table_html;
a.download = 'exported_table_' + Math.floor((Math.random() * 9999999) + 1000000) + '.xls';
a.click();
e.preventDefault();});});
This works well on Chrome and Firefox. But in IE11 when I click the export button I am getting
The webpage cannot be displayed
Most likely cause: •Some content or files on this webpage require a program that you don't have installed.
PLEASE HELP