This commit is contained in:
Anna Sudnitsina 2018-03-26 23:03:58 +03:00
parent c685cd72fc
commit 1ebbf30f8e
2 changed files with 19 additions and 10 deletions

View File

@ -16,6 +16,15 @@ $(function() {
}
})
*/
var url = "ws://" + location.host + "/socket";
var ws = new WebSocket(url);
var a, selected_node, deadNode, node2;
ws.onopen = function() {ws.send(""); };
ws.onmessage = function (evt) {
a = JSON.parse(evt.data);
displayData(a);
};
$('.tablink').css('display', 'block');
})

View File

@ -84,16 +84,16 @@
</div>
</body>
<script>
var url = "ws://" + location.host + "/socket";
var ws = new WebSocket(url);
console.log(ws);
var a, selected_node, deadNode, node2;
ws.onopen = function() {ws.send(""); };
ws.onmessage = function (evt) {
a = JSON.parse(evt.data);
displayData(a);
};
$('.tablink').css('display', 'block');
// var url = "ws://" + location.host + "/socket";
// var ws = new WebSocket(url);
// console.log(ws);
// var a, selected_node, deadNode, node2;
// ws.onopen = function() {ws.send(""); };
// ws.onmessage = function (evt) {
// a = JSON.parse(evt.data);
// displayData(a);
// };
// $('.tablink').css('display', 'block');
//
// $('#mountForm').submit(function(event){
// event.preventDefault();