There is a need to set dataType in the ajax if you expect to get json response .
$.ajax({
url: "/accept",
type: "POST",
data: myformData,
context: this,
error: function () {},
dataType: 'json',
success : function (response) {
$('#result').html('MESSAGE:'+response.Success);
console.log(JSON.stringify(response.name));
var a = response.name;
$('#name').val('');
$('#pass').val('');
}
});
0 Comment(s)