> 监听
```
//html页面a:
api.addEventListener({
name: 'myEvent'
}, function(ret, err) {
alert(JSON.stringify(ret.value));
});
//html页面b:
api.addEventListener({
name: 'myEvent'
}, function(ret, err) {
alert(JSON.stringify(ret.value));
});
```
> 发送事件
```
api.sendEvent({
name: 'myEvent',
extra: {
key1: 'value1',
key2: 'value2'
}
});
```
> 移除事件
```
api.removeEventListener({
name: 'online'
});
```
> 示例:
```
//如监听网络连接事件
api.addEventListener({
name: 'online'
}, function(ret, err) {
alert('已连接网络');
});
```