My Account | Buy CometChat

documentation

getUser()

getUser() can be used to find out if a user is online and details like profile link, avatar and status message.

The API

CometChat allows you to find out user details with the help of a call-back function. Data is sent as a JSON encoded string to the function.

jqcc.cometchat.getUser('USERID','CALLBACKFN');

Sample Code

window.onload = function() {
    jqcc.cometchat.getUser('1','checkstatus');
}

function checkstatus(data) {
    console.log(data); // To see output using Firebug
    if (data.s == 'available') {
        alert('User is online');
    }
}