I am sending a post data to get a json string back:
My JSON string:
{\"error\":false,\"success\":\"Added Website\",\"website_id\":\"12\"
You haven't provided a dataType in your $.ajax, so AJAX treats the response as a string, not an object. So, inside the success function, do this first:
dataType
$.ajax
string
success
success: function(data) { data = JSON.parse(data);