My Account | Buy CometChat

documentation

chatWith()

chatWith() function assists you to dynamically launch a chat box directly from your web paget.

The API

The chatWith() function is used to launch a chat box. The input parameter is the user’s ID with whom the conversation has to be initiated.

jqcc.cometchat.chatWith('USERID');

Sample Code

The ideal use of this function is in profile pages i.e. to add a “Chat with me” link to profiles.

<a href="javascript:void(0)" onclick="javascript:jqcc.cometchat.chatWith('1');">Chat with me</a>