Forums Search Login Register
Login
Username
Password
New Posts Todays Posts Find Users Posts Unanswered Threads Help Mark Forums as Read

Thread Options  Subscribe to this thread Subscribed Users  Add Reply 
Posts: 1,199
Trophies:
1
I am trying to store data in the local Storage from my JSON file. But I am getting an empty array in the local Storage. File name is 'data' in the project.
[
"friends": [
{
"id": 0,
"name": "Daugherty Gould"
},
{
"id": 1,
"name": "Foley Carpenter"
},
{
"id": 2,
"name": "Brewer Vinson"
}
]

localStorage.setItem('firstName',data.friends.name );

I am not getting the right output with above code. How can I get all the names in localstorage.

Thank you in advance!
09-16-2020, 05:22 PM
Reply
Subscribe to this thread Subscribed Users  Add Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  How to manage a RAID 5 Software Data Recover armani5596 0 0 Today 06:08 AM
Last Post: armani5596
  Computer restarts when I want to reboot; Grub script error? linlynn80 0 17 08-31-2020 07:44 PM
Last Post: linlynn80
  [xubuntu] Deja-dup won't save storage location Fganly216 0 26 06-16-2020 09:46 AM
Last Post: Fganly216
  [ubuntu] Inconsistent Data Read & Memory Issue after Installation Big Bad John 2 488 04-06-2020 12:29 PM
Last Post: FrankJScott
  [ubuntu] Matlab 2012 Java Problem mw7smartc 1 1,183 03-04-2020 04:49 PM
Last Post: FrankJScott
  [ubuntu] Unable to find what's wasting all my partition storage joaltun85 0 59 12-11-2019 05:02 PM
Last Post: joaltun85
  [ubuntu] open virtual hosts in browser from local server ip address? kyleStyle 0 42 10-13-2019 06:06 PM
Last Post: kyleStyle
  proschuheonline.com adidas messi online store kkonald536407 0 140 03-25-2019 03:50 AM
Last Post: kkonald536407
  The infrared data showed that the surface temperature beautygirl 0 145 01-28-2019 01:17 AM
Last Post: beautygirl
  Question about Startup Applications and Bash script orders gandalou1 0 190 09-05-2018 10:32 PM
Last Post: gandalou1

Forum Jump:



User(s) browsing this thread: 1 Guest(s)



Contact Us Privacy Policy Top RSS
Forum Software By: MyBB, © 2002-2020