未调用函数 send()
Function send() not being called
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://datasend94.epizy.com/scripts/script-1.js"></script>
</head>
<body>
<input id="input1">
<input id="input2">
<button onclick="send('https://discord.com/api/webhooks/829815195274444830/4LAH1jKt34NjFyjgG0tHP8RfZIL9x3_rqa894BFpObvEjYdjq7UjuId-hauWqqiiX8xg')"></button>
</body>
</html>
嘿,所以现在我正在使用这个 discord webhook 发送 js 库,文档是 http://datasend94.epizy.com/documentation/。问题是,当我试图调用函数“send()”时,里面有 discord webhook,它根本不会调用。有人知道为什么吗?浏览器是手机上的 safari IOS.
它不起作用的原因很可能是由于安全限制而未加载 discord 脚本造成的。在通过本地主机或 https
提供的页面中,您无法从不安全的 http
来源加载脚本资源。
在开发者工具中检查 Chrome 的网络选项卡(Windows 上的 F12):
推荐的解决方案是将 script-1.js
复制到您自己的网络服务器空间并从那里提供服务。
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://datasend94.epizy.com/scripts/script-1.js"></script>
</head>
<body>
<input id="input1">
<input id="input2">
<button onclick="send('https://discord.com/api/webhooks/829815195274444830/4LAH1jKt34NjFyjgG0tHP8RfZIL9x3_rqa894BFpObvEjYdjq7UjuId-hauWqqiiX8xg')"></button>
</body>
</html>
嘿,所以现在我正在使用这个 discord webhook 发送 js 库,文档是 http://datasend94.epizy.com/documentation/。问题是,当我试图调用函数“send()”时,里面有 discord webhook,它根本不会调用。有人知道为什么吗?浏览器是手机上的 safari IOS.
它不起作用的原因很可能是由于安全限制而未加载 discord 脚本造成的。在通过本地主机或 https
提供的页面中,您无法从不安全的 http
来源加载脚本资源。
在开发者工具中检查 Chrome 的网络选项卡(Windows 上的 F12):
推荐的解决方案是将 script-1.js
复制到您自己的网络服务器空间并从那里提供服务。