Save HTML locally with Javascript

后端 未结 10 1542
夕颜
夕颜 2020-12-03 01:19

I do know that Javascript cannot write data in the filesystem, for security reasons. I have often read that the only way to save data locally with Javascript is cookies or <

10条回答
  •  清歌不尽
    2020-12-03 01:57

    You could save files, and make it persistent using the FileSystem-API and webkit. You would have to use a chrome browser and it is not a standards technology but I think it does exactly what you want it to do. Here is a great tutorial to show how to do just that http://www.noupe.com/design/html5-filesystem-api-create-files-store-locally-using-javascript-webkit.html

    And to show that its on topic it starts off showing you how to make the file save persistent...

    window.webkitRequestFileSystem(window.PERSISTENT , 1024*1024, SaveDatFileBro);
    

提交回复
热议问题