Skip to content

Instantly share code, notes, and snippets.

@HenriqueMitsuo
Created August 18, 2020 01:13
Show Gist options
  • Save HenriqueMitsuo/32014d5519ed86f8a21ea626766bc613 to your computer and use it in GitHub Desktop.
Save HenriqueMitsuo/32014d5519ed86f8a21ea626766bc613 to your computer and use it in GitHub Desktop.
const $ = function(Selector) {
return document.querySelector(Selector);
}
$.Json = function(Object){
return JSON.parse(Object)
}
$.Ajax = function(type = "GET", link) {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange=function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("demo").innerHTML = this.responseText;
}
};
xhttp.open(type, link, true);
xhttp.send();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment