| Page 1 of 1 | [ 1 post ] |
|
I am using YUI 3 and currently I know we can write a "global ajax listener" by putting publish before any io calls in each sandbox, like this:
Code: YUI().use("io-base", function(Y){ function onSuccess(transactionid,response,arguments){ alert('start!'); } Y.Global.on('io:start',onSuccess); }); Y1 = YUI().use("io-base", "node", function(Y1){ Y1.publish('io:start',{broadcast : 2}); Y1.io("http://www.yahoo.com.hk"); }); However, is there a better way that we don't have to put each Y.publish for each sandbox? Any help will be appreciated, thanks. |
| Page 1 of 1 | [ 1 post ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group