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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T23:57:06+00:00 2026-06-10T23:57:06+00:00

Am facing issue in accessing the JSON object : JSON Object am receiving is

  • 0

Am facing issue in accessing the JSON object :
JSON Object am receiving is :

{"71":"Heart XXX","76":"No Heart YYYY"}

I tried to get the value of 71 and 72 separately and use it …

but am getting some compile time issue as :
Syntax error on token “.71”, delete this token

Code:

var map=$("#jsonText").val();
    alert(map);
    var  obj=jQuery.parseJSON(map);
    alert("JSON ::"+obj.71);

If am printing obj , am able to view [Object Object]

Can any one out there please help me to find the mistake i did ..I know the question above is asked in many threads in SO . Below are the few threads i found , but failed when i attempted to implement it ..

jquery json parsing

Also tried using the Jquery tutorial given in

Jquery JSON

Its working fine if the key is a String but getting the above error if its a number …

  • 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-10T23:57:08+00:00Added an answer on June 10, 2026 at 11:57 pm

    Try this:

    alert("JSON ::" + obj[71]);
    

    “71” isn’t a valid property identifier: an identifier should start with a letter, the underscore or the dollar sign. You can avoid this problem using square brackets instead.

    Note: everything that’s put between square brackets is converted into strings. Even functions, DOM elements or regular expressions: they’re all converted with their toString methods, or their superclass’ toString.

    So 71 there is converted into "71". If you want a little more performance you can directly use the latter. If you don’t need it, you can cut some key presses with just 71.

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

Sidebar

Related Questions

I am facing issue with the following Json reponse object in the javascript eval
Not being used to php, I'm facing an issue with accessing arrays and its
I got below JSON string, i facing issue parsing because it contains non english
Im facing an issue which I believe to be VAO-dependant, but Im not sure..
I am facing an issue with h:selectOneRadio's valueChangeListener=#{user.loadYesNo} (I use Mojarra 2-0-8 on Tomcat-7)
Recently I started facing issue with one of my scripts that loads a json
Please I am facing the following issue: Throughout my Java program, i am accessing
I m facing issue to access the bridge table to get the values using
I am working with facebook-ios-sdk, It working fine But I am facing issue related
I'm facing one issue while writing Office Outlook 2007 Add-In, I'm accessing the email

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.