xxxxxxxxxx
$.post( "ajax/test.html", function( data ) {
$( ".result" ).html( data );
});
xxxxxxxxxx
$.ajax({
method: "POST",
url: "some.php",
data: { name: "John", location: "Boston" }
}).done(function( msg ) {
alert( "Data Saved: " + msg );
});
xxxxxxxxxx
$(function(){
$('#myForm').on('submit', function(e){
e.preventDefault();
$.post('http://www.somewhere.com/path/to/post',
$('#myForm').serialize(),
function(data, status, xhr){
// do something here with response;
});
});
});
xxxxxxxxxx
$.post( "ajax/test.html", function( data ) {
$( ".result" ).html( data );
});