会员
周边
捐助
新闻
博问
闪存
赞助商
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
让学习成为一种习惯
博客园
首页
新随笔
联系
订阅
管理
2018年6月8日
javascript 自定义发布与订阅
摘要: //声明一个类,与普通的类的声明不一样, function Girl() { //将类的事件声明成一个私有的属性,里面是一个对象 this._events = {} } /* { "失恋":["哭","吃","购物"] } */ Girl.prototype.on = function (eventName,callback) { if (this._...
阅读全文
posted @ 2018-06-08 17:20 雷神约
阅读(137)
评论(0)
推荐(0)
编辑
公告