Open a save file dialog for a js variable

前端 未结 2 872

In my web app I need to give the user the option to save a js variable as a file (when the user clicks download, the app offers him to save a file, preffereably as .js file)

2条回答
  •  萌比男神i
    2021-01-15 00:56

    Check out Downloadify which allows exactly this.

    Downloadify is a tiny JavaScript + Flash library that enables the generation and saving of files on the fly, in the browser, without server interaction.

    it requires Flash installed in the user's browser to work, though.

    I know of no other way of doing this without server interaction.

提交回复
热议问题