Try it -
$(document).ready(function(){
$('#submit').click(function() {
$.ajax({
type : 'POST',
url : 'post.php',
data: {
email : $('#email').val(),
url : $('#url').val(),
name : $('#name').val()
},
success:function (data) {
$("#yourdiv").append(data);
}
});
});
});
This uses a successfunction callback ajaxto return your data to the page in the parameter data. Then the callback function adds your data to the div on the page.
You will also need -
echo $message
On your php page to give jQuery some data to work with.
source
share