body.appendChild(root)
document.body = body
+/*************/
+/* UNTESTED */
+/************
+
+
/* Poll the server. Send get request, wait for timeout, send another request.
- Do this until...? */
+ Do this until...? Can be used for either reconnecting or waiting for answer*/
function pollServerTimeout(url, data, resolve, reject) {
console.log('Polling server with offer ' + data)
const request = XMLHttpRequest()
resolve(request.response)
}
else if (request.status === 504) {
- pollServerTimeout(url, resolve, reject)
+ pollServerTimeout(url, data, resolve, reject)
}
else {
reject('server errored out with ' + request.status)