Solved

Export to CSV Button does not work on Internet Explorer

Posted on 2015-01-27
5
266 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
Find out what you should include to make the best professional email signature for your organization.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

691 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