Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要将 ExtJS TextArea 的内容导出到文本文件。我搜索了文档,但没有找到与 textarea 相关的任何内容。这可能吗?
准备文件名以及将文本区域内容导出到文件的能力也是理想的选择。
帮助表示赞赏。
谢谢
您不能只将 JS 文件中的内容保存到用户本地计算机文件系统的任何位置。这是一个巨大的安全漏洞,它只是不能以这种方式工作。但是,您有几个选择:
将此信息发送到您的服务器并为用户提供文件链接。用户单击该链接服务器将响应信息 - 浏览器保存该数据。你甚至可以让浏览器自动下载内容(好吧,无论如何,大部分都是这样)
或者您可以要求用户右键单击并将此信息复制到剪贴板中。