mercredi 9 septembre 2020

store and retreive element sessionStorage with changing color bookmark

I have to do this exercise and the instructions are clear: everything must be generated in javascript.

This is a book search form with the possibility for the user to save books in his favorites (the my poch list section).

To do this I use the session storage API.

My problem is twofold: when I click on the bookmark icon, it must be green as long as it remains in the favorites, including by doing a new search. Also when I delete a book from the my poch list section, the whole selection is deleted when I refresh the page while the user must be able to delete his books independently of the others and add more books if necessary in another search.

  • At line 242 i try to do the deleting function.

  • At line 357 the retreiving storage is display on load

  • At line 275 there is the bookmark function

There are the 3 place i have errors.

It's the first time i use sessionStorage API. Hope you could help me

fHere the entire code in Codepen or

Here the entire code in codeSandbox

Thanks.




Aucun commentaire:

Enregistrer un commentaire