<li>Access your local cosmopolite debug page (replace port if necessary): <ahref="http://localhost:8080/cosmopolite/static/debug.html"target="_blank">http://localhost:8080/cosmopolite/static/debug.html</a></li>
<li>Load <ahref="http://localhost:8080/test.html"target="_blank">your test page</a><b>in an incognito window</b> (right click/control-click, Open Link in Incognito Window)</li>
<li>The debug page should show the message from the test page</li>
<li>You've written code that uses cosmopolite!</li>
</ol>
<h3>Time out for concepts</h3>
<ol>
<li><b>Subject</b>: a topic that clients that publish and subscribe to, e.g. "books"</li>
<li><b>Message</b>: a single chunk of data transmitted to a single subject, e.g. "I love books!"</li>
<li><b>Key</b>: an optional string associated with a message, that can be used to look up the last message with a given key, e.g. "title" (key) = "A place to talk about books" (message)</li>
<li><b>Client</b>: an instance of Cosmopolite() in a browser</li>
<li><b>Profile</b>: a collection of clients that all speak as the same user (and so should appear the same to subscribers)</li>
</ol>
<h3>Subscribe to a subject</h3>
<ol>
<li>Change your test script:
<pre>var callbacks = {
onMessage: function(msg) {
alert(msg['message']);
},
};
var cosmo = new Cosmopolite(callbacks);
cosmo.subscribe('testsubject');</pre></li>
<li>Load (or re-load) the test page (still in an incognito window)</li>
<li>Cosmopolite can be used as a key/value store, with historical data and update notification</li>
<li>Use the debug interface to send several messages to <i>testsubject</i>. Some of them should have the key <i>testkey</i>, while others should have different keys or no key.</li>