0

Simple question:

Here is my string:

{Path:5984fcb4-8bf8-4205-86f8-e6e2042ba610.jpg,StatusCode:OK}

Why can't I parse my string to Json using the following method:

var obj = $.parseJSON(data);

This site says also my json is not in a correct format.

What do I have to do to transfer this kind of data in json format?

Thanks in advance,

1
  • These doesn't work too: {Path: "37028c2a-362d-49a5-9c59-f13c1188f9e7.jpg", StatusCode: "OK"} Commented Sep 11, 2013 at 13:58

2 Answers 2

1

The string needs to look like this:

{"Path":"5984fcb4-8bf8-4205-86f8-e6e2042ba610.jpg","StatusCode":"OK"}

You might also need single quotes around that:

'{"Path":"5984fcb4-8bf8-4205-86f8-e6e2042ba610.jpg","StatusCode":"OK"}'
Sign up to request clarification or add additional context in comments.

Comments

1

Not proper, needs quotes around keys and values for proper json

{"Path":"5984fcb4-8bf8-4205-86f8-e6e2042ba610.jpg","StatusCode":"OK"}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.