AspNetCore.Docs/aspnet/whitepapers/whats-new-in-aspnet-45-and-.../samples/sample11.cs

7 lines
236 B
C#

// Receive a string message from the server.
socket.onmessage = function(msg)
{
document.getElementById("serverData").innerHTML = msg.data;
};
// Send a string message from the browser.
socket.send(document.getElementById("msgText"));