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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T03:41:54+00:00 2026-05-30T03:41:54+00:00

I am a javascript noob. I have a JSON string created by google gson

  • 0

I am a javascript noob. I have a JSON string created by google gson API after creating the json string which I am passing it to my javascript function. So in a javascript variable I have a string as follows

'{"validationCode":"V10291","caseNumber":"2010CF101011","documentSource":"EFILE","countyDocumentID":"CD102","documentTitle":"D Title","signedDate":"01/01/2012","signedBy":"CPSJC","comments":"YES Comments"}'

How to iterate over this or get a value of the key something like I have to find validationCode or caseNumber, but this is String? Any suggestions are welcome

  • 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-30T03:41:55+00:00Added an answer on May 30, 2026 at 3:41 am

    You can get it into a native JavaScript object with JSON.parse:

    var obj = JSON.parse(yourJSONString);
    

    Then you can iterate the keys with a standard for in loop

    for(var k in obj)
        if ({}.hasOwnProperty.call(obj, k))
            console.log(k, " = ", obj[k]);
    

    Or access particular keys like validationCode or caseNumber directly:

    var caseNum = obj.caseNumber;
    var validationCode = obj.validationCode;
    

    Note that really old browsers don’t support JSON.parse, so if you want to support them, you can either use Papa Crockford’s json2, or jQuery, which has a parseJSON utility method.

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

Sidebar

Related Questions

A bit of a noob question here... I have a javascript function on a
I've recently been looking at functional programming with Javascript, to which I'm a noob.
I am a Javascript noob and I need help adding a codeblock after a
Little help for a javascript noob please... I have this in a .js file
I'm a complete JavaScript noob. I am using this right now: $(function() { $(#tabs).tabs({
I have a javascript function that someone made for me. I am kind of
Ok..so I'm a nOOb with jquery. I have a dynamically created list of items
Greets! I'm a noob struggling to learn html and javascript - getting there slowly.
JavaScript allows functions to be treated as objects--if you first define a variable as
JavaScript does funky automatic conversions with objects: var o = {toString: function() {return 40;

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.