Failed to execute 'atob' on 'Window'

前端 未结 4 1578
被撕碎了的回忆
被撕碎了的回忆 2020-12-03 13:29

I\'m trying to save my HTML file in Chrome when the user presses ctrl + s keys but Chrome is crashed.

(I want to download just the source code of my HTM

4条回答
  •  借酒劲吻你
    2020-12-03 13:57

    here's an updated fiddle where the user's input is saved in local storage automatically. each time the fiddle is re-run or the page is refreshed the previous state is restored. this way you do not need to prompt users to save, it just saves on it's own.

    http://jsfiddle.net/tZPg4/9397/

    stack overflow requires I include some code with a jsFiddle link so please ignore snippet:

    localStorage.setItem(...)
    

提交回复
热议问题