【问题标题】:Get message from pubnub received JSON从 pubnub 获取消息接收到的 JSON
【发布时间】:2016-12-16 14:35:53
【问题描述】:

Received JSON

我想获取对象“Message”的值,即本例中的数字。 这是我已经拥有的:

pubnub.addListener({
    status: function(statusEvent) {
        console.log(statusEvent);

    },
    message: function(message) {
        console.log("New Message!!", message);
        var mesg = message.getValueof(message.message());
        console.log(mesg);



    },

【问题讨论】:

  • 忘了说 var mesg... 显然不起作用
  • 我们不能用 message.message 实现吗??
  • 是的............我使用webstorm,它说它不会工作,但是当我真正测试它时它确实有效,谢谢
  • 天哪,我只是把石头扔进黑暗里.....

标签: jquery json cordova pubnub


【解决方案1】:

你可以使用message.message从你的json中获取

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-10-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-07
    • 1970-01-01
    相关资源
    最近更新 更多