Triggering a file download without any server request

前端 未结 4 1320
粉色の甜心
粉色の甜心 2020-12-06 05:43

Greetings,

I\'m working on a JS-based application that does some complex work and logs some information (actually, up to hundreds of lines) on a

4条回答
  •  没有蜡笔的小新
    2020-12-06 06:37

    Unfortunately this is not something you can do with normal browser capabilities. Something like flash or a browser-specific plugin will get you what you need, but security limitations within javascript will not let you download arbitrary data created within the browser.

    Also the 'data' url is not supported across all browser/version combinations. I am not sure if your users are constrained on what browser they are using or not but that may limit what you can do with that solution.

提交回复
热议问题