A few years ago, Matt and Gaston wrote a good introduction to XMPP Publish and Subscribe. You can read it here. Back then, Pubsub was regarded the killer feature of XMPP looking for an application. Since then, Twitter has now shown us how to use Pubsub and many XMPP clients like Jappix now have realtime micro-blogging implementations using XMPP Pubsub.
I have been developing realtime business web applications that use Pubsub for a while now and my normal tools for such work would be Flex/ActionScript with XIFF to develop the Flash client and Java for the Openfire plugin. With Pubsub, I am not doing the classic client request and server response of multiple HTTP pages from a web server. It is usually a single page dynamically updated on each client responding to pushed subscribed events as they are published among clients. The server side code is just another publisher. Read this for more infromation about this approach.
In evaluating the myriad of JS frameworks/libraries, I used the excellent TodoMVC.
In the spirit of the TodoMVC project, here is a TodoMVC implementation of Backbone.Marionette with XMPP Pubsub all working in Openfire with no server side code. Pubsub manages the storing and distribution of the JSON data. Open as many application web pages. They are all showing the same data always in sync in realtime. If I wrote a server script in OpenfireJS, it would not be to respond to client requests, but to publish new Todos from an independent source.