<h3>Example for pipe track_*</h3>
<div class="note">
    <ul>
        <li><a href="http://comet-server.org/doku.php/en" target="_blank">More info about CppComet</a></li>
        <li><a href="http://comet-server.org/doku.php/en:comet:cometql"  target="_blank">More info about CometQL</a></li>
        <li><a href="http://comet-server.com/wiki/doku.php/en:comet:javascript_api"  target="_blank">More info about auth JavaScript API</a></li> 
    </ul>
    
    <p>
        Open this page from different browsers and you will see incoming messages from CppComent about other users who opened or closed this page in other devices.
    </p> 
</div>
<div class="root">  
    <hr>
    
    <div id="log"></div>
</div>
 

hr{
    clear:both;
}

.hide{
    display:none;
}

#log{
    color:#000
}
.status{
    color:#272;
    font-weight:bold;
}

.note{
    background:#eee;
    padding:1px 10px;
    margin:5px;
    border-radius:5px;
    text-align:justify;
}

function log()
{
    console.log(arguments);
    $("#log").append(JSON.stringify(arguments)+"<hr>");
}
 
cometApi.subscription("track_online", function(msg)
{ 
    log(msg) 
});	
/*
cometApi.subscription("track_online.subscription", function(msg)
{
    log(msg) 
});	

cometApi.subscription("track_online.unsubscription", function(msg)
{
    log(msg) 
});	
 */
cometApi.start({dev_id:15, node:"app.comet-server.ru"}); 

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js
  2. https://comet-server.com/CometServerApi.js