gpt4 book ai didi

javascript - Twitter 关注按钮未出现在本地主机设置中

转载 作者:行者123 更新时间:2023-11-30 06:53:23 26 4
gpt4 key购买 nike

我去了 Twitter 开发工具网站 here ,我为跟随意图设置了按钮代码。

twitter follow screenshot

所以我将以下代码发布到我的网站:

<a href="https://twitter.com/example" class="twitter-follow-button" data-show-count="false">Follow me on Twitter!</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>

但是在我的 Jekyll localhost:8000 上,我看到的是:

just the link

按钮不出现。有任何想法吗?我禁用了所有 adblocks 并尝试了不同的浏览器。也许是它现在只有本地主机?我只是想知道在那种情况下我如何调试它(如果是这样,为什么会这样)。

谢谢!

最佳答案

Twitter 按钮总是出现在本地主机中,或者即使您创建一个普通的 html 文件并嵌入代码并在本地运行它也是如此。然而,有 3 种情况,几乎所有社交按钮都适用。

1) Make sure that you test it on a running web server.

2) Check on other browsers before concluding the inefficiency of your code.

3)Secondly code for 'Twitter' button should be in the index file rather than any other partials. It will certainly work and that goes for almost all the other social buttons.

关于javascript - Twitter 关注按钮未出现在本地主机设置中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26195499/

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