Caf*_*eek 5 javascript xml excel content-type
在javascript中,我有一个字符串,包含一个SpreadsheetML文件(excel xml)
我想打开一个新窗口,并将这些数据写入其中,但将其作为 excel 打开。
我可以从 javascript 中做到这一点吗?
phi*_*hag 5
是的,您可以使用数据 URL来做到这一点。首先,将文档编码为base64。然后,使用以下 URL 作为窗口的源:
var mtype = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'; var url = 'data:' + mtype + ';base64,' + base64data; window.open(url);
这将需要一个现代 浏览器。
归档时间:
14 年,1 月 前
查看次数:
4310 次
最近记录: