summaryrefslogtreecommitdiff
path: root/day9/task5/static/js/utils.js
diff options
context:
space:
mode:
authorAndrew <saintruler@gmail.com>2019-07-21 12:14:09 +0400
committerAndrew <saintruler@gmail.com>2019-07-21 12:14:09 +0400
commit2305ced85888a23f86ecfcdfb64a3b69c4997a4c (patch)
tree9d5cc4ad1c322ca2bf46b990498ad0a79d508aff /day9/task5/static/js/utils.js
parent8c8712f0e6b165f6967f5d2958f300df6182296c (diff)
Переписан бекенд. Добавлена валидация при обновлении значений в ряду.
Удалена предыдущая версия приложения без vue.
Diffstat (limited to 'day9/task5/static/js/utils.js')
-rw-r--r--day9/task5/static/js/utils.js33
1 files changed, 0 insertions, 33 deletions
diff --git a/day9/task5/static/js/utils.js b/day9/task5/static/js/utils.js
deleted file mode 100644
index d76c547..0000000
--- a/day9/task5/static/js/utils.js
+++ /dev/null
@@ -1,33 +0,0 @@
-const request = {
- get: function (url, callback) {
- let xmlHttp = new XMLHttpRequest();
- xmlHttp.onreadystatechange = function() {
- if (xmlHttp.readyState === 4 && xmlHttp.status === 200)
- callback(xmlHttp.responseText);
- };
- xmlHttp.open("GET", url, true);
- xmlHttp.send();
- },
-
- post: function (url, callback, data) {
- let xmlHttp = new XMLHttpRequest();
- xmlHttp.onreadystatechange = function() {
- if (xmlHttp.readyState === 4 && xmlHttp.status === 200)
- callback(xmlHttp.responseText);
- };
- xmlHttp.open("POST", url, true);
- xmlHttp.send(this.formatParams(data));
- },
-
- formatParams: function (params) {
- return Object.keys(params).map((key) => {
- return key+"="+encodeURIComponent(params[key])
- }).join("&")
- }
- };
-
-function elementFromHTML(html) {
- let elem = document.createElement('div');
- elem.innerHTML = html;
- return elem.firstChild;
-}