【问题标题】:Javascript (Userscript) Smartphone Notification via PushOver通过 PushOver 的 Javascript(用户脚本)智能手机通知
【发布时间】:2015-01-03 15:48:09
【问题描述】:

我正在尝试使用用户脚本中的 PushOver AVI 向我的智能手机发送消息。

代码如下:

function sendMsg() {

    $.ajax({
        type: "POST",
        url: "https://api.pushover.net/1/messages.json",
        datatype: "application",
        token: "xxXxXxXXXxXx",
        user: "xXxXXYXxyxX",
        device: "samsungs4",
        message: "This is a test message",
        sound: "echo",
        success: function(){ console.log("Message sent"); },
        error: function(){ console.log("Couldn't send message"); }
    });
}

但是,当我从随机网站执行此脚本(在用户脚本中添加为 @match)时,我收到错误 400“错误请求”。

根据他们的 API,我的请求看起来很好,但我想不出为什么它不起作用。

也许有更多经验的人可以帮助我。

【问题讨论】:

    标签: javascript android push-notification push pushover


    【解决方案1】:

    将所有内容都发布为数据:解决问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多