Hey guys! This is my first time trying my hand at ajax and im just putting my foot in the water first. i’m trying to make it so when the form is submitted, the data is shown on the page. Here’s the code:
$('document').ready(function () {
$('form #submit').click(function(e){
e.preventDefault();
var formdata = $('form').serialize();
$.ajax({
type: 'POST',
url:'ajax_recieve.php',
data: formdata,
dataType: 'html',
success: function(data){
data.appendTo('footer');
}
});
});
});
the php code:
<?php
if($_POST){
return "post sdssd";
}
?>
can someone help me with this code please?