Skip to content

Instantly share code, notes, and snippets.

@luislobo14rap
Created December 25, 2019 00:01
Show Gist options
  • Save luislobo14rap/3ec7670c23e97a33adc75287e2185782 to your computer and use it in GitHub Desktop.
Save luislobo14rap/3ec7670c23e97a33adc75287e2185782 to your computer and use it in GitHub Desktop.
get.js
// get.js v1
function get(url, callback) {
let request = new XMLHttpRequest();
request.open('GET', url, true);
request.onload = function() {
callback(this, this.responseText);
};
request.send();
};
// get.min.js v1
function get(a,b){let c=new XMLHttpRequest;c.open("GET",a,!0),c.onload=function(){b(this,this.responseText)},c.send()}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment