Skip to content

Instantly share code, notes, and snippets.

@Raynos
Created February 22, 2012 22:23
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Raynos/1887906 to your computer and use it in GitHub Desktop.
Save Raynos/1887906 to your computer and use it in GitHub Desktop.
$.ajax({
type: "POST",
url: "some.php",
data: "name=John&location=Boston"
}).done(function( msg ) {
alert( "Data Saved: " + msg );
});
$.post("some.php", "name=John&location=Boston", function( msg ) {
alert( "Data Saved: " + msg );
});
var xhr = new XMLHttpRequest();
xhr.addEventListener("done", function ( msg ) {
alert( "Data Saved: " + msg );
});
xhr.open("POST", "some.php");
xhr.send("name=John&location=Boston");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment