Posting jQuery
$.post( "test.php", { name: "John", time: "2pm" })
.done(function( data ) {
alert( "Data Loaded: " + data );
});
Glamorous Goat
$.post( "test.php", { name: "John", time: "2pm" })
.done(function( data ) {
alert( "Data Loaded: " + data );
});
$.post("demo.php",{id:1})
.done(function(data) { console.log(data) })
.fail(function() { console.error("Error") })
$.ajax({
method: "POST",
url: "some.php",
data: { name: "John", location: "Boston" }
}).done(function( msg ) {
alert( "Data Saved: " + msg );
});
$(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;
});
});
});
$.post( "ajax/test.html", function( data ) {
$( ".result" ).html( data );
});