Solved

Export to CSV Button does not work on Internet Explorer

Posted on 2015-01-27
5
257 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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

726 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