mirror of
https://github.com/sigmasternchen/MyTube
synced 2025-03-15 21:08:55 +00:00
21 lines
538 B
JavaScript
21 lines
538 B
JavaScript
![]() |
function ajaxGet(url, callback) {
|
||
|
var http = new XMLHttpRequest();
|
||
|
http.open("GET", url, true);
|
||
|
http.onreadystatechange = function () {
|
||
|
if (http.readyState === 4) {
|
||
|
callback(http.responseText);
|
||
|
}
|
||
|
}
|
||
|
http.send(null);
|
||
|
}
|
||
|
|
||
|
function ajaxPost(url, data, callback) {
|
||
|
var http = new XMLHttpRequest();
|
||
|
http.open("POST", url, true);
|
||
|
http.onreadystatechange = function () {
|
||
|
if (http.readyState === 4) {
|
||
|
callback(http.responseText);
|
||
|
}
|
||
|
}
|
||
|
http.send(data);
|
||
|
}
|