Contents | Index | Previous | Next
TAgentJS.addTMasterListenerJS() Method
subscribe for master updates
Synopsis
Tango_agent.addTMasterListenerJS(document);
Arguments
document Object implementing TMasterListenerJS interface. A document to receive master
updates.
Returns
Nothing.
Description
Example
Applications normally register for master messages to manage their private
protocols and maintain distributed state information. The example below, merely
alerts about changes.
<script>
- ar Tango_agent=//register in Tango
Tango_agent.addTMasterListenerJS(this);
function Tango_masterChanged(isMaster,masterName)
{
if(isMaster)
alert("I'm the master.");
else
alert(masterName+" has become the master.");
}
</script>
See Also
TMasterListenerJS interface, TAgentJS.removeTMasterListenerJS() method