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

  • Home
  • SEARCH
  • 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 8400293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:31:41+00:00 2026-06-09T21:31:41+00:00

I need to parse a table to JSON, I found this solution and it

  • 0

I need to parse a table to JSON, I found this solution and it works:

    var tab=[{"value":"1.0","label":"Alabama"},{"value":"2.0","label":"Alaska"},        {"value":"3.0","label":"American Samoa"}];
    var myJsonString = JSON.stringify(tab);  
    var jsonData = $.parseJSON(myJsonString);

The problem is when I declare dynamically the two dimensional table ‘tab’ it doesn’t work:

    var tab_desc1= new Array(3);
    tab_desc1[0]=new Array(2);
    tab_desc1[0]["value"]="1.0";
    tab_desc1[0]["label"]="Alabama";
    tab_desc1[1]=new Array(2);
    tab_desc1[1]["value"]="2.0";
    tab_desc1[1]["label"]="Alaska";
    tab_desc1[2]=new Array(2);
    tab_desc1[2]["value"]="3.0";
    tab_desc1[2]["label"]="American Samoa";
    var myJsonString = JSON.stringify(tab_desc1);    
    var jsonData = $.parseJSON(myJsonString);

Logically my declaration contains error, bur I can’t see it.
Any help! Thanks.

  • 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-09T21:31:43+00:00Added an answer on June 9, 2026 at 9:31 pm
    tab_desc1[0] = new Array(2);
    

    Should be

    tab_desc1[0] = {};
    

    And same with others.

    But I don’t know the purpose of stringify a variable to string and then parse it back.

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

Sidebar

Related Questions

I need a tool to parse Lua table expressions. If all else fails, I
i have a table with a lot of stuff, i need to parse it
Hi I need parse and deserialize pseudo JSON string. Input data: {aBubbleData[ 'jaja2581' ]={
Need to parse a file for lines of data that start with this pattern
I need to parse a JSON string in my project, which runs on BB
i need to parse simple JSON php in my tableview for that i searched
I need to read a html page and parse the contents of a table
I need to create a dynamic html table using PHP after parsing a JSON
I need to parse this html code using HtmlAgilityPack and C#. I can get
I'm new to JSON and trying this tutorial: http://p-xr.com/android-tutorial-how-to-parse-read-json-data-into-a-android-listview/#comments I'm new to JSON, C

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.