Solved

Export to CSV Button does not work on Internet Explorer

Posted on 2015-01-27
5
245 Views
Last Modified: 2015-01-28
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
0
Comment
Question by:jatkin
  • 2
  • 2
5 Comments
 
LVL 19

Expert Comment

by:Rikin Shah
ID: 40572499
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.
0
 
LVL 4

Author Comment

by:jatkin
ID: 40572502
Thanks for the input.
Unfortunately Flash is not an option due to the targeted platforms.
Are there any other options?
0
 
LVL 19

Accepted Solution

by:
Rikin Shah earned 500 total points
ID: 40572511
Server side code instead of JavaScript...
0
 
LVL 44

Expert Comment

by:Rainer Jeschor
ID: 40572541
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
0
 
LVL 4

Author Closing Comment

by:jatkin
ID: 40575250
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
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now