Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function httpGetAsync(theUrl, callback, caller) {
- var xhr = new XMLHttpRequest();
- xhr.onreadystatechange = function() {
- if (xhr.readyState === 4 && xhr.status === 200) {
- callback.apply(caller, [JSON.parse(xhr.responseText)]);
- } else {
- console.log("Status de la r�ponse:" + this.status, this.statusText);
- }
- }
- xhr.open("GET", theUrl, true);
- xhr.send(null);
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement