gpt4 book ai didi

javascript - Disqus 评论未通过 https 加载

转载 作者:行者123 更新时间:2023-12-03 04:21:11 25 4
gpt4 key购买 nike

昨天,我们使用 Disqus URL 映射器更改了几个 URL,但现在评论不知为何无法通过 https 加载,而是通过 http 加载>..

代码如下所示:

    var disqus_shortname = 'ourname';

(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();

我们更改的网址:

http://domain.be/blog/2017/03/27/blog-name-old/, http://domain.be/blog/2017/03/27/blog-name/
https://domain.be/blog/2017/03/27/blog-name-old/, https://domain.be/blog/2017/03/27/blog-name/

我已经读过这篇文章,但这不起作用 Why are disqus comments not loading over https?

最佳答案

这种行为是有道理的:http URL 与 https URL 是不同的资源,您不能指望其中一个 URL 的注释会自动显示在其他。

Disqus' URL mapper tool应该可以解决问题。

关于javascript - Disqus 评论未通过 https 加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43939831/

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