XMPP JavaScript Library using WebSocket - Documenatation

Download JavaScript XMPP Library

Creating XMPP Object (Skelton)

Following code shows how to call Connect function of xmppClient object with all the callback handling.

    
        xmppClient.connect({
            username:<username>, 
            password:<password>,
            resource:<resource>,
            host:'<ip-address-or-host-name-of-xmpp-server>',
            http_ws_url:'<url-of-websocket-to-connect>',
            debug:1, //0=disabled, 1=enabled
            onFailure:function(msg){

            },
            onSuccess:function(){

            },
            onDisconnect:function(msg){

            },
            onMessageReceive:function(message){

            },
            onPresenceReceive:function(presence){

            },
            onSubscriptionRequestReceive:function(request){

            },
            onSubscriptionRequestAccept:function(request){

            },
            onSubscriptionRequestRejectOrCancel:function(request){

            },
            onUnSubscribe:function(request){

            },
            onTypingStatusChange:function(from, status){

            },
            onRosterReceive:function(roster){

            },
            onDelivered:function(from, id){

            },
            onArchiveReceive:function(info){

            },
            onRosterPush:function(rosterEntry){

            },
            onRosterEntryRemove:function(rosterEntry){

            },
            onBlockListReceive:function(blockList){

            }
        });