Link to home
Create AccountLog in
ASP.NET

ASP.NET

--

Questions

--

Followers

Top Experts

Avatar of Starr Duskk
Starr DuskkπŸ‡ΊπŸ‡Έ

JSON.parse Invalid character error
I am trying to retrieve a json string and parsing it.

I've tried both:
var obj = $.parseJSON(data);
and
var t = JSON.parse(data);

They return "Invalid character error."

My data being returned is:
{"AttemptId":"5180301"}

Open in new window


And when I view it in the debugger, it looks like this:
User generated image
It is erroring in the jquery-1.11.2.min.js file with the catch here:
User generated image
And the actual error looks like above when I step through it.

I looked at all the examples and they were using single quotes, so I found and used a manual serializer and sent this instead, with single quotes instead of the double quotes, so there would be no escaped characters.
{'AttemptId':'123456'}

Open in new window



But still the same error. Do you see any reason I should be getting the invalid character error?

thanks!

Zero AI Policy

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


ASKER CERTIFIED SOLUTION
Avatar of zzynxzzynxπŸ‡§πŸ‡ͺ

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Create Account

Avatar of Starr DuskkStarr DuskkπŸ‡ΊπŸ‡Έ

ASKER

that was it! thanks!

Avatar of zzynxzzynxπŸ‡§πŸ‡ͺ

You're welcome!
Glad that helped.
Thanx 4 axxepting.

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.

ASP.NET

ASP.NET

--

Questions

--

Followers

Top Experts

The successor to Active Server Pages, ASP.NET websites utilize the .NET framework to produce dynamic, data and content-driven web applications and services. ASP.NET code can be written using any .NET supported language. As of 2009, ASP.NET can also apply the Model-View-Controller (MVC) pattern to web applications