Link to home
Start Free TrialLog in
Avatar of Member_2_99151
Member_2_99151

asked on

Export to CSV Button does not work on Internet Explorer

Hi all,

I have on a number of pages within a web app, code to generate a CSV file and download it via the browser.
This has been working fine, but now it seems to have stopped working in Internet Explorer!

$('#csv_log_export').click(function ()
{
    PopulateCsv();
    var downloadLink = document.createElement("a");
    downloadLink.href = AppViewModel.page_model.csv_data();
    downloadLink.download = AppViewModel.page_model.csv_file_name();
    document.body.appendChild(downloadLink);
    downloadLink.click();
    document.body.removeChild(downloadLink);
});

Open in new window


Any ideas what has changed?

Many thanks,

James
Avatar of Rikin Shah
Rikin Shah
Flag of India image

Hi,

This will not work on IE. You must use any server side code.

You can check with this example. -
Downloadify- http://davidwalsh.name/downloadify

However, you will require flash for this. You need to be careful in case you are designing the page for any tablet. Just check if the tablet supports flash.
Avatar of Member_2_99151
Member_2_99151

ASKER

Thanks for the input.
Unfortunately Flash is not an option due to the targeted platforms.
Are there any other options?
ASKER CERTIFIED SOLUTION
Avatar of Rikin Shah
Rikin Shah
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi,
what kind of Javscript framework are you using?
Can you confirm that the code was run successful prior to a specific date?
Have you tested the functionality in other browsers like Firefox and Chrome?

As it seems that the CSV generation runs only on the client side, perhaps some sort of security update in IE which blocks this type of link generation / execution.

It might also help if you can show the function
PopulateCsv()

Open in new window

as well as what is behind
AppViewModel.page_model.csv_data()

Open in new window

and
AppViewModel.page_model.csv_file_name()

Open in new window


Thanks
Rainer
Makes a lot of sense to move in this direction for this....
Only a matter of time until the other browsers move in this direction.
Thanks