Parse JSON response got from AJAX request through JavaScript

I'm geting a JSON response with an AJAX request through JavaScript.

Here is the response:

{"responseCode":400,"errors":false,"submitted":false,"content":"some content","notice":""}

My Goal is to get the content:

"some content"

The json variable is the data in my case. So, I have tried with:

data.content

But I am geting an empty string.

Any idea on how to access the string?

Thank you in advance.

Answers:

Answer

Did you first parse json ?

var data = JSON.parse(json);

than read data.content

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.