Forum Moderators: open
I'm trying to do a dynamic popup window with cvs data that'll automatically have msexcel open (or better yet, ask you to save or open) some csv data using javascript.
...something along the lines of:
function clicky() {
var pop1 = open("", "win1", "width=400 height=400 ");
var doc = pop1.document.open("application/msexcel");
doc.writeln("cow,12,moo");
doc.writeln("dog,20,arf");
doc.writeln("cat,41,meow");
doc.close();
pop1.focus();
}
is this doable in js? If I replace "application/msexcel" with "text/plain", it seems to work (that is, puts in the line breaks, so we know it's not parsing html anymore), but when trying to have it export to excel, it doesn't seem to be very happy. What am I missing?
Bonus points if it also works in Firefox! (seems that only IE recognized the "text/plain" in my previous experiment).
Thanks!
p.s. gah! why won't this thing let me do proper 4-space indentation? :)
But then MS says:
"text/html" Default. Currently the only MIME type supported for this method.
..which isn't true either, as you already know.