Skip to content

Instantly share code, notes, and snippets.

@fearphage
Forked from segdeha/ajax-post.js
Last active October 28, 2015 19:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fearphage/5c24f9e4a91b73752317 to your computer and use it in GitHub Desktop.
Save fearphage/5c24f9e4a91b73752317 to your computer and use it in GitHub Desktop.
Smallest possible Ajax implementation of POST requests (187 characters)
function p(u,p,c){with(new XMLHttpRequest)open('POST',u),setRequestHeader('Content-type','application/x-www-form-urlencoded'),onreadystatechange=function(){3<readyState&&c(this)},send(p)}
@segdeha
Copy link

segdeha commented Oct 28, 2015

Brilliant!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment