gpt4 book ai didi

javascript - appspot 上的 cookiechoices 不起作用

转载 作者:行者123 更新时间:2023-11-28 07:50:30 24 4
gpt4 key购买 nike

我尝试在 appspot 上从 cookieChoices.org 运行 cookieChoices.js,但在检查元素时出现以下错误

无法加载资源:服务器响应状态为 404(未找到)http://whatsonpontyclun.appspot.com/cookiechoices.js Uncaught ReferenceError :cookieChoices 未定义whatsonpontyclun.appspot.com/:36

我已经将 cookieChoices 加载到根目录中,因为我理解了说明,但我也尝试将文件加载到/static/js 中,这是我保存其他 javascript 文件的地方。我得到同样的错误。

什么给出了?

最佳答案

您还需要在着陆页中包含代码:

<HTML>
<HEAD>
</HEAD>
<BODY>
<script src="/cookiechoices.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function(event) {
cookieChoices.showCookieConsentBar('This site uses cookies to improve your reading experience. ',
'Click here to accept cookies', 'Click here to refuse cookies', 'http://www.islandpublishers.co.uk/cookietest/cookieask.html');
});
</script>​

我在允许用户拒绝 cookie 时遇到问题。

关于javascript - appspot 上的 cookiechoices 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26872225/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com