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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:31:44+00:00 2026-06-17T09:31:44+00:00

It seems there are different standards out there on labels for JSON, some want

  • 0

It seems there are different standards out there on labels for JSON, some want quotes around JSON object labels, some do not. Can someone tell me what the standard is?

Quotes are bad camp

Chrome

{"label":1111} – SyntaxError: Unexpected token :

{label:1111} – Works

Firefox

{"label":1111} – SyntaxError: invalid label

{label:1111} – Works

Quotes are good camp

JSLint

{"video_id":1111} – JSON: good.

{video_id:1111} – JSON: bad. Expected a string and instead saw ‘video_id’

PHP

echo json_encode(array('label' => 1111));
{"label":1111}
  • 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-17T09:31:44+00:00Added an answer on June 17, 2026 at 9:31 am

    The standard is to parse JSON as JSON.

    The JSON language (unlike Javascript) always requires all property names to be surrounded by double-quotes.

    Your syntax errors come from trying to parse JSON as Javascript statements. The {} is parsed as a statement block, and the label: is parsed as a GOTO target.
    Since statement labels cannot have quotes, this results in a syntax error.

    If you wrap the JSON literals in parentheses to force Javascript to parse them as expressions, you won’t get that error.

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

Sidebar

Related Questions

Are there any standards for switching out connection strings for different environments in C#
There seem to be a number of different ways in which one can create
i've been playing some time with different builds of my application and there seem
It seems there are no free* .NET performance profilers that can profile on a
I am trying to read command lien argument but it seems there is some
My app has a registered shutdown function and it seems there's some issues with
Here's what I want to do. It seems simple, but I can't get it
There seem to be very different opinions about using transactions for reading from a
There seems to be a difference between the last commit, the HEAD and the
Seems there's nothing to do… using the combo prototype/lowpro, no problems at all with

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.