Created
December 25, 2019 00:01
-
-
Save luislobo14rap/3ec7670c23e97a33adc75287e2185782 to your computer and use it in GitHub Desktop.
get.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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(); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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