tags:

views:

271

answers:

2

hello, I am beginner if dojo and can't understand following line of code in dojo

dojo.event.topic.publish("show_detail");

A: 

The snippet in question looks old. It "publishes" a "topic" called "show_details" with no parameters. It means that if there are any subscribers to this event, they are going to be called with no parameters. In general this is a mechanism to decouple your code with programatic event instead of using direct function calls + it allows to chain subscribers for free.

Eugene Lazutkin
A: 

Your snippet looks from an old version of dojo, but the idea behind this is still the same in recent versions of dojo (only the syntax changed). To find out more about this I recommend you reading the DojoCampus article about dojo.publish.

Joscha