Json Response Object

This is driving me nuts.

I have used Json call backs perfectly and now I’m getting errors on the object.

The object returned is for example {“id”:“13”,“status”:“1482190931.png”}
I have always used JSON.parse(data) to use the return object correctly and use it at will but I when using a picedit API I get the following error.

JSON.parse: unexpected character at line 1 column 2 of the JSON data

Any clues on how I can use the returned object? Anyone?

Do you think that’s enough information to allow a stranger to help you solve the problem?

Probably not but I am all ears.

Sounds an awful lot like a BOM (Byte Order Mark) issue.

Are you sure it’s utf-8 without BOM ?

You’ve lost me on that one

A BOM indicates whether bytes should be read as Big Endian or Little Endian.

That roughly means from left to right or right to left eg.
Should this be read as “123” or “321”

They are gremlinish because they are whitespace and usually can’t be seen unless you deliberately look for them as the first “character”

I’ve checked for white space but there is none.

Firebug shows the correct response and alerting the object gives an object thus.
[object XMLHttpRequest]

So for some reason I can’t parse it.

Figured out the problem.

The form is being sent and returning correctly.
The picedit function is just calling whether the form is submitted or not so the object is boolean not the actual response object.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.