mirror of
https://github.com/django/daphne.git
synced 2025-04-20 08:42:18 +03:00
Onopen timing fixes in docs
This commit is contained in:
parent
8e84c0ce87
commit
58cc3c845d
|
@ -141,6 +141,8 @@ need to change the socket address if you're using a development VM or similar)::
|
|||
socket.onopen = function() {
|
||||
socket.send("hello world");
|
||||
}
|
||||
// Call onopen directly if socket is already open
|
||||
if (socket.readyState == WebSocket.OPEN) socket.onopen();
|
||||
|
||||
You should see an alert come back immediately saying "hello world" - your
|
||||
message has round-tripped through the server and come back to trigger the alert.
|
||||
|
@ -235,6 +237,8 @@ code in the developer console as before::
|
|||
socket.onopen = function() {
|
||||
socket.send("hello world");
|
||||
}
|
||||
// Call onopen directly if socket is already open
|
||||
if (socket.readyState == WebSocket.OPEN) socket.onopen();
|
||||
|
||||
You should see an alert come back immediately saying "hello world" - but this
|
||||
time, you can open another tab and do the same there, and both tabs will
|
||||
|
|
Loading…
Reference in New Issue
Block a user