Below code not going to succeed, it is showing failure message.. anybody can help
$.ajax({
type: 'GET',
url: 'xyz.com/form_api.php',
data: {
name: 'John',
email: '123333',
mobile: 'deep@gmail.com',
message: 'Test'
},
success: function(response) {
console.log(response);
$('#contact_form #contact_results2').html('Success');
},
error: function(errorThrown) {
console.log(errorThrown);
$('#contact_form #contact_results2').html('failed');
}
});
Try this code:
$.ajax({
type: 'GET',
url: 'xyz.com/form_api.php',
data: { 'name': 'John', 'email': 'deep@gmail.com', 'mobile': '123333', 'message': 'Test'
},
success: function(response)
{
console.log( response );
$("#contact_form #contact_results2").html("Success");
},
error: function(errorThrown)
{
console.log( errorThrown );
$("#contact_form #contact_results2").html("failed");
},
});