Data URI used to export to CSV/Excel (no server-side request) : browser support/limitations?

穿精又带淫゛_ 提交于 2019-12-05 17:07:58

问题


Following the questions:

  • Javascript or Flash export to CSV/Excel
  • Is it possible to use any HTML5 fanciness to export local storage to Excel?

and as suggested, I'm thinking about generating a CSV file content in the client and then use a Data URI to prompt an "open-in-Excel" action from the browser. After reading the limitations and different levels of support of this feature (Data URI) from browsers I'd like to know about first-hand experience of this technique and about things I've to take care of.

Thx.


回答1:


I have not been able to reliably make it work in IE. You could use server side resources for IE and data urls for everything else, but if you are writing that server side code anyway, then in most cases it is probably better to use it universally.

I found a related question at:

Data URI scheme and Internet Explorer 9 Errors

If it absolutely must be done on the client side and usage of flash is acceptable, you could try something like:

http://datatables.net/extras/tabletools/



来源:https://stackoverflow.com/questions/8176859/data-uri-used-to-export-to-csv-excel-no-server-side-request-browser-support

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!