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:
parse1
It is erroring in the jquery-1.11.2.min.js file with the catch here:
parse2
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!
LVL 2
Starr DuskkASP.NET VB.NET DeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

zzynxSoftware engineerCommented:
parseJSON() takes a string as input.
Are you sure that your data variable is a String?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Starr DuskkASP.NET VB.NET DeveloperAuthor Commented:
that was it! thanks!
0
zzynxSoftware engineerCommented:
You're welcome!
Glad that helped.
Thanx 4 axxepting.
0
Starr DuskkASP.NET VB.NET DeveloperAuthor Commented:
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JSON

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.