Created
July 22, 2018 23:20
-
-
Save easrng/9936e2fc60a7cca7d8548c978d5935d6 to your computer and use it in GitHub Desktop.
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
(function (){ | |
"use strict"; | |
window.sel=window.sel||{}; | |
/* Start Ajax */ | |
function get(url) { var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { return this.responseText; } };xhttp.open("GET", url, true);xhttp.send();}function post(url, params) { var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { return this.responseText; } };xhttp.open("POST", url, true);xhttp.send(params);} window.sel.ajax = {get:get,post:post}; | |
/* End Ajax */ | |
/* Start HTML */ | |
function query(q){return document.querySelector(q);} window.sel.html = {query:query}; window.sel.q = query; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment