minor js fixes

This commit is contained in:
Devaev Maxim
2018-07-16 05:16:53 +03:00
parent 52bf4f38e4
commit 211401b52c
4 changed files with 27 additions and 15 deletions

View File

@@ -1,8 +1,9 @@
var tools = new function() {
this.makeRequest = function(method, url, callback) {
this.makeRequest = function(method, url, callback, timeout=null) {
var http = new XMLHttpRequest();
http.open(method, url, true)
http.onreadystatechange = callback;
http.timeout = timeout ? timeout : 5000;
http.send();
return http;
};