use websocket to check for oml

This commit is contained in:
j 2014-08-12 14:50:56 +02:00
parent ad5f6a584e
commit 2c5f9823f2

View file

@ -1,10 +1,15 @@
function load() {
var base = 'http://[::1]:9842',
img = new Image();
img.onload = function(event) {
document.location.href = base;
var base = '//[::1]:9842',
ws = new WebSocket('ws:' + base + '/ws');
ws.onopen = function(event) {
document.location.href = 'http:' + base;
};
ws.onerror = function(event) {
ws.close();
};
ws.onclose = function(event) {
setTimeout(load, 500);
};
img.src = base + '/static/oxjs/build/Ox.UI/png/transparent.png?' + new Date;
};
function update() {