As I work on developing a website that recommends locations to visit in NYC, I am facing an issue with saving JSON data in local storage. My goal is to allow users to add their own suggestions and eventually integrate MongoDB into the site. To build the site's DOM, I rely on the JSON data. However, after around 15 page reloads, I start experiencing a loss of storage space.
[[{"_name": "Stacks Pancake House & Smokehouse BBQ"
transforms into :
"[[{\\\"_name\\\":\\\"Stacks Pancake House & Smo…on\\\
The addition of extra backslashes seems to be the root cause of this problem, as they accumulate with each reload and eventually lead to no more storage space being available. Furthermore, these unnecessary backslashes disrupt the proper building of the site (DOM) from the JSON data. I'm currently unable to pinpoint the exact source of this issue.
GitHub: https://github.com/dogboy602k/NYC146/tree/jsonversion