HTML and CSS Reference
In-Depth Information
// Indicate that this handler should be called repeatedly
return true;
}
function pingHandler(ping) {
var pingId = ping.getAttribute("id");
var from = ping.getAttribute("from");
var to = ping.getAttribute("to");
var pong = $iq({type: "result", "to": from, id: pingId, "from": to});
connection.send(pong);
// Indicate that this handler should be called repeatedly
return true;
}
Suggested Extensions
Now that we've built a basic browser-based chat application, you can take this example
and do lots of other cool things to turn it into a full-fledged application.
Build a User Interface
Our example web page, chat.html , obviously does not have the most beautiful or usable
user interface. Consider enhancing the UI of your chat client to incorporate more user-
friendly features like tabbed conversations, automatic scrolling, and a visible contact list.
Another benefit of building this as a web application is that you have many powerful tools
for making a gorgeous and flexible design come to life with HTML, CSS, and JavaScript.
Use XMPP Extensions
XMPP has a rich extension ecosystem. There are hundreds of extension proposals or
“XEPs” on http://xmpp.org . These range from functionality like avatars and group chat
to VOIP session initialization.
XMPP can be a great way to add social features to web applications. The built-in
support for contacts, presence, and chat provides a social core on top of which you can
add collaboration, social notifications, and so on. Many extensions have this goal. These
include XEPS for microblogging, commenting, avatars, and publishing personal event
streams.
Connect to Google Talk
Google Talk, the chat service you may be familiar with from Gmail and Google+, is
actually part of the Jabber IM network. There is a publicly accessible XMPP server
listening on talk.google.com on port 5222 . If you have a Google account, you can point
 
Search WWH ::




Custom Search