I made a simple chat app to play with the browser-to-server part of a web page. It is not trying to replace anything. I mostly wanted to get a message from one browser onto another screen.
The page uses jQuery to post a message to PHP. PHP appends it to an HTML log, and the clients reload that log with AJAX every two and a half seconds. The page compares the content and adjusts the scroll position so new messages can stay in view. A PHP session keeps track of the name used in the room.
There is no database and no persistent connection. It is the fairly straightforward polling version of chat, with all the tradeoffs that go with that. Still, it is a useful little experiment: once a page can send an action and ask for updated state, there are a lot more things it can do than just load a document.