Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7789307
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T21:15:33+00:00 2026-06-01T21:15:33+00:00

I was doing some test with json and ran into several issues. hope somebody

  • 0

I was doing some test with json and ran into several issues. hope somebody on this mailing list can help out.

localStorage[LOC] = JSON.stringify(track);
            var boy = localStorage[LOC];
            alert(boy);

This is the data I get back

[{"lat":42.5877511,"lng":-71.7873177,"acc":67,"date":"Sat Apr 14 2012 01:03:46 GMT-0400 (EDT)"}]

I was wondering how I could access the json objects like we do in a regular array.

For debugging purposes I did something like,

alert(boy[0].lat);

But the result I got back was undefined

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T21:15:35+00:00Added an answer on June 1, 2026 at 9:15 pm

    Run the string through JSON.parse() to get back your object:

    var boy = JSON.parse(localStorage[LOC]);
    

    JSON.parse() is essentially the opposite of JSON.stringify(). You run stringify to turn an object into a string for local storage, and when you pull the string back out of local storage, you run parse to turn the string back into an object.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

after doing some test-code for this link : Is it safe to call temporary
Im doing some test creating an instance of HTMLDocument this way: object[] pageText =
I am doing some long simulations that can take from several hours to several
I have been doing some research on test driven development and find it pretty
I'm new in Silverlight and i am doing some tests. With my current test
I'm trying to insert some data from a proprietary JSON database into MongoDB for
Need some advise on what I am doing wrong during client JSON parsing... Tips
i'm doing a simple parse of some JSON and it's giving me an error
I have been looking in to doing some test driven development for one of
I'm doing some Unit/Integration testing in a Non-Java language (Python), using a test-framework (

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.