K
K
kikosko2018-07-15 14:42:59
JavaScript
kikosko, 2018-07-15 14:42:59

Why doesn't adding/removing items in "LocalStorage" work?

  • When I add: the name, phone and mail of the user in localSrorage using the method: addContact(), in order to create a table from the data that is in localStorage, the method: show(). Then I get an error when adding: Uncaught TypeError: Cannot read property 'value' of undefined
  • Also there is no deletion of the contact, I'm trying to do it with the method: deleteContact(e). And I get this error: Uncaught TypeError: Cannot read property 'splice' of undefined

My code

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
eRKa, 2018-07-15
@kttotto

It falls right here
because when initializing localStorage['addbook'] = "", and it cannot convert this to json.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question