I have data that I want to write to a file, and open a file dialog for the user to choose where to save the file.
(我有要写入文件的数据,然后打开文件对话框供用户选择保存文件的位置。)
It would be great if it worked in all browsers, but it has to work in Chrome.(如果它在所有浏览器中都可以运行,那就太好了,但是必须在Chrome中运行。)
I want to do this all client-side.(我想在所有客户端这样做。)
Basically I want to know what to put in this function:
(基本上我想知道要在此函数中添加什么:)
saveFile: function(data)
{
}
Where the function takes in data, has the user select a location to save the file, and creates a file in that location with that data.
(该函数接收数据的位置,让用户选择一个位置来保存文件,并使用该数据在该位置创建一个文件。)
Using HTML is fine too, if that helps.
(如果有帮助,使用HTML也可以。)
ask by user1756980 translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…