2
http://developer.yahoo.com/yui/datasource/#events如何將事件掛接到YUI中的數據源?
我試圖使用responseParseEvent,但我不知道如何掛鉤到我的數據源對象,因爲YUI沒有提供任何示例。
旁註:有沒有人注意到這與YUI?他們的文檔不包含與jQuery幾乎相同的示例?
http://developer.yahoo.com/yui/datasource/#events如何將事件掛接到YUI中的數據源?
我試圖使用responseParseEvent,但我不知道如何掛鉤到我的數據源對象,因爲YUI沒有提供任何示例。
旁註:有沒有人注意到這與YUI?他們的文檔不包含與jQuery幾乎相同的示例?
instance.subscribe(eventName的,回調)可以在YUI跨組件大多數事件標準的簽名2.
myDataSource.subscribe('responseParseEvent', function (e) {
/*
* available properties:
* e.request
* e.response
* e.callback
* e.caller
*/
});
YUI 3遵循類似的慣例,但是使用上()和之後的()的方法
myYUI3DataSource.on('data', function (e) { ... });