It seems a bizarre question but i’m really confused, because when downloaded this example from Tornado i thought that: okey, i run it, and it will work! but the problem, it dident work, because i tested in in Offline mode, and dident have jQuery in cache!
And found this from SO:
Ajax – create connection to server send some data (simplified as get / post), and receive response.
Long poll – create connection to server, send some data, keep connection and receive sometimes from server some data. Connection is kept for short time, and does periodical reconnection. On server side it still dealt like Web Page.
WebSockets – create connection to server, and keep is as long as needed. Server or client can easily brake it. Bidirectional sending of data. WebSockets usually uses masking for each message so data is simply encrypted.
So then, why there is always Javascript under the hood even it’s something related to server side?
JavaScript is important to WebSocket only in browsers because the browsers have implemented the WebSocket API (See RFC 6455) in JavaScript. So if you want to access WebSocket from within an HTML5 page, you need to write JavaScript. However, you can also do WebSocket in a client in Java by using a Java Applet. (Although applets have fallen out of favor.) Additionally, it is possible to do WebSocket from native applications, including mobile iOS.
Many WebSocket server platforms try to support multiple types of clients. For example, Kaazing provides clients not only in JavaScript, but also in .NET, Silverlight, Java and Objective-C. The basic idea with WebSocket is that you write your server logic once, and you can then “harvest” what you did in various different clients.
Just keep in mind that if you are going to do WebSocket, you will need a programming language other than basic HTML tags because you need to process the data coming in over the WebSocket connection. That data can come via many different protocols, such as AMQP, STOMP, socket.IO, WAMP and many others. For each type of protocol, you will actually need a different library that can handle processing the protocol.