开发者

Save or Download Javascript String as a file

开发者 https://www.devze.com 2023-01-31 01:22 出处:网络
I have an HTML str开发者_StackOverflowing in javascript variable. I have to save/Download the string as a file on link click. It should be cross browser compatible.

I have an HTML str开发者_StackOverflowing in javascript variable. I have to save/Download the string as a file on link click. It should be cross browser compatible.

I thought window.open with attachment Content-Disposition header, but not good solution because popup may be blocked.


As mentioned here, you could use downloadify: https://github.com/dcneiner/Downloadify. The client will need flash though.

0

精彩评论

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

关注公众号