overwrite a file with HTML5 FileWriter

前端 未结 5 577
我寻月下人不归
我寻月下人不归 2021-01-01 22:30

I\'m using HTML5 FileWriter API to save the state of my webapp. I have bit of JS that periodically calls FileWriter.write to do that (so , over time, the

5条回答
  •  滥情空心
    2021-01-01 22:50

    A workaround is the following code:

    this._writer.truncate(0);
    window.setTimeout(function(){
        this._writer.write(content);
    }.bind(this),500)
    

    This simply wait 500 milliseconds before writing. Not great but it works...

提交回复
热议问题