www: use location.hostname for hostname

This commit is contained in:
Oleg Kalachev
2019-07-20 19:50:43 +03:00
parent bc0e45740f
commit f7d3122f58
2 changed files with 2 additions and 2 deletions

View File

@@ -3,7 +3,7 @@ var titleEl = document.querySelector('title');
var modeEl = document.querySelector('.mode');
var batteryEl = document.querySelector('.battery');
var url = 'ws://' + location.host + ':9090';
var url = 'ws://' + location.hostname + ':9090';
var ros = new ROSLIB.Ros({ url: url });
function speak(txt) {

View File

@@ -1,5 +1,5 @@
var ros = new ROSLIB.Ros({
url : 'ws://' + location.host + ':9090'
url : 'ws://' + location.hostname + ':9090'
});
var titleEl = document.querySelector('title');