[Answered ]-Json recognised as String

2πŸ‘

As harish-reddy said, the dataType property sets the behaviour to what you expect the response to be. That said the β€œdata” argument of the success function is already a JavaScript object.

Refer to http://api.jquery.com/jQuery.ajax/

As arpit-solanki mentioned the message property inside the response object is not an array, but is interpreted as a string (notice the starting β€˜β€β€˜), therefor you either change the server side to send you an actual array or you must JSON.parse(data.message) to obtain its content.

πŸ‘€joaolpinho

0πŸ‘

The response you are receiving is already executed by JSON.stringify.Either you must use JSON.parse or change the logic at the server end

πŸ‘€Abdur Rehman

Leave a comment