Save JSON data to text file and read it

后端 未结 2 1934
走了就别回头了
走了就别回头了 2020-12-18 17:30

Is there possible to save JSON data into local text file? So later i can use it again using by load that file and get the stored JSON data back. Actually want i really want

2条回答
  •  难免孤独
    2020-12-18 17:53

    Is there possible to save JSON data into local text file?

    Yes. Currently JavaScript at linked jsfiddle creates a .txt file, not a valid JSON file.

    You can use try..catch..finally and JSON.parse() to check if input at

    
    

提交回复
热议问题