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 6332251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:13:35+00:00 2026-05-24T18:13:35+00:00

I know in concept, or reality even they are essentially one in the same.

  • 0

I know in concept, or reality even they are essentially one in the same. However I know working with JSON objects (as of the time of writing this at least). That Altering the data within a given set of objects isn’t the easiest thing. Of course I could be wrong, there could be an easy means of doing it all JSON. Which leads me to my actual question.

I am working almost entirely with JSON formatted Objects. Most of which I need to update frequently for storage for later use. Personally I would like to avoid sending data to and from the server to rebuild the JSON set of Objects every time. So I guess in all I am wondering if there is an equivalent to something like PHP’s json_encode, json_decode? Either natively in JavaScript or through the jQuery Lib. and If not, how can I achieve something like that cause I feel (again at the moment) working with array’s vs a JSON object is much easier (correct me if I am wrong).

  • 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-05-24T18:13:37+00:00Added an answer on May 24, 2026 at 6:13 pm

    The reason why this question pops up in your mind is because you don’t understand neither Javascript or JSON enough.

    The Javascript array is always the numerical array. There is no associate array in JavaScript like the one you get in PHP using json_decode(json, true);. When people talking about associate array in JavaScript, they are in fact using JavaScript objects and it’s properties, i.e.,

    var my_so_called_array = {};
    
    my_so_called_array['first_item'] = 'hello world';
    alert(my_so_called_array['first_item']); // 'hello world'
    alert(my_so_called_array.first_item); // also 'hello world'
    

    One of the best about JSON is that the syntax is a subset of the object literal notation. That means JSON string itself is valid code for representing the “associate array” in Javascript. The “conversion” couldn’t be simpler, just eval() the string as code will do:

    var my_data = eval(json_string);
    

    Or, use jQuery.parseJSON() or JSON.parse():

    var my_data = jQuery.parseJSON(json_string);
    
    var my_data = JSON.parse(json_string);
    

    The reason people prefer using jQuery.parseJSON() or JSON.parse() over eval() is because eval is evil:

    1. It’s slower
    2. It doesn’t check the validity of the JSON code, makes it suspect-able to injection attack.

    Does the above explanation answer your question? You can find more information about JSON at http://www.json.org.

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

Sidebar

Related Questions

I don't know this concept is there or not. Can we store the Files
I'm confused about concept of Framebuffer and Renderbuffer. I know that they're required to
The concept of a coroutine sounds very interesting, but I don't know, if it
Know of an OCAML/CAML IDE? Especially one that runs on Linux?
Know of any good libraries for this? I did some searches and didn't come
I know this might be a no-brainer, but please read on. I also know
I know the concept of OOP for couple of years and I'm aware of
I just started with QT and I know the concept of signal/slot but in
I know its a not a new concept that my site is perfect on
I don't know if I totally got the concept wrong, but I want to

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.