I received this JSON-encoded data:
{
"error": {
"msg":"Concurrent verifications to the same number are not allowed",
"code":10
}
}
and I tried to access the 'msg' value using JavaScript as follows:
$("#buttonPhoneSubmit").click(function(e) {
$("#verifyForm").show();
e.preventDefault();
$.ajax({
type: 'post',
url: './process.php',
data: $('form').serialize(),
datatype:'json',
success: function (data) {
$('#error_message').html(data.error.msg);
}
});
However, I encountered an issue where it reported that the 'data' is undefined. Can someone identify what's causing this problem in the code?
Thank you!