>[info] H.addEventListener(callback, name, extra, options);,監聽系統定義或用戶自定義事件,支持雙系統調用。
*****
#### 輸入參數
##### **callback**:回調函數,Function類型,函數傳入參數:
~ ret:JSON對象類型,無說明,如果事件帶有`extra`參數,可以通過`ret.value`獲取。
~ err:JSON對象類型,無說明。
##### **name**:自定義事件或系統事件名稱,String類型
##### **extra**:附加字段,JSON對象類型
*****
#### 使用示例
```
// 監聽系統事件
H.addEventListener(function(ret,err){},"offline");
// 監聽自定義事件
H.addEventListener(function(ret,err){},"customEvent");
// 監聽事件,并傳入附加字段
H.addEventListener(function(ret,err){},"scrolltobottom",{
threshold: 0
});
```
- 序言簡介
- 約定與規則
- 捐贈與外包
- 版本迭代
- 開始使用
- 屬性
- appId
- appName
- appVersion
- systemType
- systemVersion
- version
- deviceId
- deviceToken
- deviceModel
- deviceName
- operator
- connectionType
- fullScreen
- screenWidth
- screenHeight
- winName
- winWidth
- winHeight
- frameName
- frameWidth
- frameHeight
- pageParam
- wgtParam
- appParam
- wgtRootDir
- fsDir
- cacheDir
- 事件
- batterylow
- batterystatus
- keyback
- keymenu
- volumeup
- volumedown
- offline
- online
- pause
- resume
- scrolltobottom
- shake
- swipedown
- swipeleft
- swiperight
- swipeup
- tap
- longpress
- viewappear
- viewdisappear
- noticeclicked
- appintent
- smartupdatefinish
- 方法
- v
- M
- trim
- getFileExt
- getAgeForBirthDay
- isNumber
- isPlusDecimal
- isDate
- getNowDateFormat
- transPHPTimestamp
- transJsTimestamp
- isObject
- cloneObj
- extendObj
- isFunction
- isArray
- newGUID
- unique
- addEventListener
- 常量
- 模板引擎
- 語法糖
- 建議收集