JavaScript exporting JSP div data to excel file
<p>I have a java script code for exporting div data to excel file :</p>

<pre><code>$(".excelIcon").click(function(e) {
        //getting values of current time for generating the file name
        var timeStamp = new Date().getTime();
        //creating a temporary HTML link element (they support setting file names)
        var a = document.createElement('a');
        var data_type = 'data:application/vnd.ms-excel';
        //getting data from our div that contains the HTML table
        var htmlImg = $('&lt;div&gt;').append($('.div1').clone()).html();
        var html = htmlImg.replace(/&lt;img[^&gt;]*&gt;/g,"");
        var table_html = html.replace(/ /g, '%20');
        a.href = data_type + ', ' + table_html;
        //setting the file name
        a.download = 'file' + '_' + timeStamp + '.xls';
        //triggering the function
        a.click();
        //just in case, prevent default behaviour
        e.preventDefault();
    });
</code></pre>

<p>I have used type as <strong>application/vnd.ms-excel</strong> which is a microsoft standard for exporting jsp data to excel , my problem is that this code is running in chrome , means I am able to export jsp data to excel in chrome but it is not working in IE, safari and firefox (I am unable to download excel from above code in these three browser).
Can anyone guide me that what I am lacking for these browsers.
Thanks in advance.</p>
