I have the following code and output, and I cant fine any error on the json data to be decoded. Can anyone please help me in finding this error
CODE:
jQuery is clever enough to parse the response as it is, even if dataType
isn't specified.
In your case, it is specified and therefore, it is already parsed and data
is the parsed JSON object.
What you are doing is therefore parsing an Object
.
Doc says:
dataType: (default: Intelligent Guess (xml, json, script, or html))
Type: String
The type of data that you're expecting back from the server. If none is specified, jQuery will try to infer it based on the MIME type of the response (an XML MIME type will yield XML, in 1.4 JSON will yield a JavaScript object, in 1.4 script will execute the script, and anything else will be returned as a string). The available types (and the result passed as the first argument to your success callback) are: