开发者

How do I export client side content to Word document via javascript?

开发者 https://www.devze.com 2023-01-06 18:08 出处:网络
I\'m familiar with generating office documents server-side by including the following at the top of the response:

I'm familiar with generating office documents server-side by including the following at the top of the response:

<%
Response.Buffer = True
Response.ContentType = "application/msword"
Response.AddHeader "content-disposition", "inline; filename = ASP_Word_Doc.doc"
%>

I'm currently facing the challenge of doing this purely client-side. 开发者_开发百科I've got an XSL transform that successfully generates valid Word XML. Can anybody give me a pointer to how to reproduce this behaviour using purely client-side javascript?

I've found the document.open method, but that only supports text/html.

Ideally I'd like a cross-browser solution - but IE only would be a satisfactory fall-back

cheers, Ian


To answer one part of your question, Downloadify is a Flash-based JS helper library that lets you generate any kind of file for download locally.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号