【发布时间】:2015-06-25 07:59:35
【问题描述】:
这是我的订阅代码,我想获取频道 ID,所以我在代码中使用了 this.channel,但我没有定义。有什么办法可以得到channelid
pubnub.subscribe({
channel: changing dynamically,
presence: function (m) {
console.log(m)
},
message: function (m) {
console.log(m);
console.log("Channel ==" + this.channel)
},
error: function (error) {
// Handle error here
console.log(JSON.stringify(error));
}
})
结果: 频道==未定义
【问题讨论】: