Functiondojo.publish

<script src="../../js/dojo.js"></script>
defined in dojo/_base/connect.js

Invoke all listener method subscribed to topic.

Usage

function (/*String*/ topic, /*Array*/ args) (view source)
parametertypedescription
topicStringThe name of the topic to publish.
argsArrayAn 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" ]);