开发者

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

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

dojo.event.topic.publish("show_detail")开发者_JAVA技巧;


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜