I get the Json by using the post Method,
$.post('urlhere', function (data) {
alert(data.Experience)
});
If I trying to get one element from the JSON Response like alert(data.Experience).But It will show "Undefined".How to get the particular node from the following Json?
Get the Response like,
[
{
"Name": null,
"EmployeeId": 0,
"Email": null,
"UserName": null,
"Password": null,
"JobTitle": null,
"JobID": null,
"SkillsRequired": "Struct",
"Experience": "2",
"Description": null,
"listval": null,
"Status": null,
"JobLocation": null,
"JobPostedDate": "/Date(-62135596800000)/",
"AssignJobID": null,
"AssignJobTitle": null,
"AssignJobHr": null,
"AssignDateofInterview": "/Date(-62135596800000)/",
"AssignDescription": null
}
]
JSON values cannot be one of the following data types: a function. a date. undefined.
If it's a JSON, it's a string, so it doesn't have that property. You are trying to use it as an object (the O in JSON). Save this answer.
It means that the editor failed to get a response to the server or the response wasn't in a valid JSON format. Basically, if the editor can't communicate with the server, it will show this error message instead. To fix the problem, you essentially need to fix whatever is getting in the way of the communication.
First make sure that the JSON that you are receiving is a parsed form of json or a string, If it is a string parse it before accessing values from it like JSON.parse(data)
. And the second thing is the data
that you are receiving is a kind of array, so you must need to specify the index to access the values inside it meaning the JSON.
Try,
alert(data[0].Experience);
Try with
JSON Array 0th Object Has Experience.SO Acces Like Below
alert(data[0].Experience)
DEMO
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With