在我的网络应用程序中,我需要为用户提供将 js 变量保存为文件的选项(当用户点击下载时,应用程序会建议他保存文件,最好是 .js 文件)。
类似于 google docs 为您提供保存文件的功能。
javascript 是否可以通过这种方式传递它的变量?
最佳答案
查看 Downloadify这正是允许的。
Downloadify is a tiny JavaScript + Flash library that enables the generation and saving of files on the fly, in the browser, without server interaction.
不过,它需要在用户的浏览器中安装 Flash 才能工作。
如果没有服务器交互,我知道没有其他方法可以做到这一点。
关于javascript - 打开一个 js 变量的保存文件对话框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2980569/