Sysadmin by day, developer by night

If you read the YUI3 Event documentation, at least to me, it looked like global events able to be caught in multiple sandboxes is a difficult thing. There’s documentation about publishers and event targets…

No need, it is as simple as:

Y.Global.fire('globalevents:myevent');

In one sandbox, and in the other(s)

Y.Global.on('globalevents:myevent', function() { alert('globalevents:myevent fired');});

Excuse the lack of formatting, I am also trying out the Tumblr app on my android phone so not quite sure how this will turn out.

blog comments powered by Disqus
Technorati Profile