I am trying to write a javascript which allows user to save file in csv format. I am able to this partially with save as option as text with below code: var w = window.frames.w;
w = document.createElement("iframe");
w.id = "w";
w.style.display = "none";
document.body.insertBefore(w);
w = window.frames.w;
w = window.open("", "_temp", "width=100,height=100");
var d = w.document;
d.open("text/plain","replace");
d.charset = "utf-8";
d.write(content);
d.close();
var name = "batchExport_ash.txt";
d.execCommand("SaveAs", null, name)
Please can anyone guide me here. Many thanks.