About Local Storage [closed]

0

Good evening! I'm doing a job for college that is an online store. Well, I was not able to get the buy button to send to the shopping cart page until a friend told me about Local Storage, the problem is that I've never seen anything about it, can anyone give me a hand? To do it in html, I already have the buy button, I need to have this send the product information (price, name) to the shopping cart and once you get there, it will add the prices if you have more than one product. Note: I am a beginner. Thanks!

    
asked by anonymous 26.05.2017 / 05:36

1 answer

2

Local Storage is a feature for local data persistence that is available from HTML5. This means the latest browser should be supported.

When I say persistence of local data, I mean that you will save the data in the person's browser without having to persist in a database that is on your server.

Local Storage saves strings by default, but nothing prevents you from serializing JSONs and storing them as strings.

As it comes to a college project, I do not know how demanding your teacher will be. If it was in a real scenario, I believe Local Storage would not be the ideal technology to implement a shopping cart.

You can learn more about Local Storage here: link

    
26.05.2017 / 06:11