Skip to content
Snippets Groups Projects
Verified Commit 1a523d29 authored by TheJoeCoder's avatar TheJoeCoder
Browse files

Bundle socket.io and jquery with app

parent 793df2dc
Branches main
No related tags found
No related merge requests found
# Debtometer
A (possibly) comedic way to visualise how good of a person I am because I've lent money to my friends with no expectation of them returning it.
Also a (slightly passive-agressive) way to try to coerce them into giving my money back please.
This diff is collapsed.
This diff is collapsed.
......@@ -3,7 +3,17 @@
<head>
<title>WebSocket Example</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/3.1.3/socket.io.js"></script>
</head>
<body>
<h1>WebSocket Example</h1>
<input type="text" id="message" placeholder="Type a message">
<button onclick="sendMessage()">Send</button>
<br>
<textarea id="responsearea"></textarea>
<script src="{{ url_for('static', filename='js/jquery.min.js') }}"></script>
<script src="{{ url_for('static', filename='js/socket.io.min.js') }}"></script>
<script type="text/javascript">
var socket = io.connect('http://' + document.domain + ':' + location.port);
......@@ -12,7 +22,7 @@
});
socket.on('response', function (data) {
console.log('Server says: ' + data);
$('#responsearea').val($('#responsearea').val() + '\n' + data);
});
function sendMessage() {
......@@ -20,12 +30,6 @@
socket.emit('message', message);
}
</script>
</head>
<body>
<h1>WebSocket Example</h1>
<input type="text" id="message" placeholder="Type a message">
<button onclick="sendMessage()">Send</button>
</body>
</html>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment