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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:29:35+00:00 2026-05-27T03:29:35+00:00

I started getting errors in my browser, parsing JSON return data from the server.

  • 0

I started getting errors in my browser, parsing JSON return data from the server. At first I thought it is something specific to my data, but even something silly like

{"a": 1}

results in the error “invalid label” in Firefox and “SyntaxError: Unexpected token :” in Chrome. When changing it to

{a:1}

(i.e. removing the double quote around the label) it works fine. However, I am sure that even with the double quotes, it is valid JSON (and JSONLint agrees with this).

The workaround I have seen is to surround the JSON object with brackets like so:

({"a":1})

and this works from the browser console, but not when I change my server data (which is responding to a JSONP call) and I can’t change it in the browser either, because I am using a library (Dojo) and I don’t have the opportunity to intercept the return data before it is parsed.

UPDATE

I found a bug in my server code where I am not wrapping the data in a JS function for the JSONP response. This has fixed the problem, and I subsequently need to delete this question. Apologies, and thanks for the responses though.

  • 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-27T03:29:36+00:00Added an answer on May 27, 2026 at 3:29 am
    {"a": 1}
    

    standing alone is not json, it’s a block.

    Where "a": would be a jump label for continue. And such labels are written without ".

    Whereas ({"a":1}) is an expression. And as such {"a": 1} will get parsed as json.

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

Sidebar

Related Questions

Started getting errors with SQL Server 2005 This is the first time i've tested
Just started getting a bunch of errors on our C# .Net app that seemed
Just moved a site over to a new server and we started getting some
I'm trying to use slime from CVS (2009-01-05) but keep getting this error: LOAD:
Since yesterday I started encountering errors related to date formats in SQL Server 2008.
I started getting this error when posting the form back with Model Binder. To
I just started getting this error today, seemingly out of nowhere. Any one see
Out of the blue today I started getting this error in Visual Studio 2008
I'm running IIS 6.0 on Windows 2003 and started getting this error: Compiler Error
Recently I've switched to Ninject 2.0 release and started getting the following error: Error

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.