dojo.publish
<script src="../../js/dojo.js"></script>
defined in dojo/_base/connect.js
Invoke all listener method subscribed to topic.
parameter | type | description |
---|---|---|
topic | String | The name of the topic to publish. |
args | Array | An array of arguments. The arguments will be applied to each topic subscriber (as first class parameters, via apply). |
Examples
Example 1
dojo.subscribe("alerts", null, function(caption, message){ alert(caption + "\n" + message); };
dojo.publish("alerts", [ "read this", "hello world" ]);