I have a strange behavior in my webserver.
im using this HTML with B4J WebSockets client library v0.91
As soon as i place the Canvas in the index.html and press the button on the website, my browser tells me the websocket connection is closed but the Canvas drawing works further after this message.
if i remove the canvas, see Button works again.
What did i missed?
im using this HTML with B4J WebSockets client library v0.91
B4X:
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>AWTRIX 2.0</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.js"></script>
<script src="/b4j_ws.js"></script>
<link rel="stylesheet" type="text/css" href="index.css" />
</head>
<body>
<div style="margin-left: 50px;">
<h1>AWTRIX 2.0</h1>
<canvas id="cvs" width="800" height="500"></canvas>
<button type="button" id="btnnext">Next App</button><br/>
</div>
<script>
$(document).ready(function() {
b4j_connect("/ws");
});
</script>
<script>
var ctx;
$( document ).ready(function() {
ctx = document.getElementById('cvs').getContext('2d')
b4j_connect("/mst/ws");
});
function Clear() {
ctx.clearRect(0, 0, $(cvs).width(), $(cvs).height());
};
function Rect(x, y, width,height,r,g,b) {
ctx.fillStyle = "rgb("+r+","+g+","+b+")";
ctx.fillRect(x, y, width, height);
};
function Line(x1, y1, x2, y2) {
ctx.beginPath();
ctx.moveTo(x1,y1);
ctx.lineTo(x2,y2);
ctx.stroke();
};
</script>
</body>
</html>
As soon as i place the Canvas in the index.html and press the button on the website, my browser tells me the websocket connection is closed but the Canvas drawing works further after this message.
if i remove the canvas, see Button works again.
What did i missed?