Skip to content

Instantly share code, notes, and snippets.

@andi1984
Forked from goofmint/gist:1625495
Created April 25, 2013 22:39
Show Gist options
  • Save andi1984/5463814 to your computer and use it in GitHub Desktop.
Save andi1984/5463814 to your computer and use it in GitHub Desktop.
.get(url,callback);
.ajax {
type:'POST', //defaults to GET
url:'/api/getinfo', //defaults to window.location
contentType:'application/json', //defaults to application/x-www-form-urlencoded
headers:{},
dataType:'application/json', //defaults to text/html
data:{username:foo}, //Can be a Key/Value pair string or object. If it's an object, $.serialize is called to turn it into a Key/Value pair string
success:function(data){}, //function to call on successful Ajax request
error:function(data){}, //function to call when an error exists in the Ajax request
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment