0

我对新的可嵌入 Youtube 订阅按钮有疑问。当我尝试使用此代码时:

<script src="https://apis.google.com/js/plusone.js"></script>
<div class="g-ytsubscribe" data-channel="youtube" data-layout="default"></div>

没有按钮出现。我正在从硬盘驱动器运行一个 html5 文件,我什至尝试下载这个 js 文件并从同一位置运行,但什么也没发生。该代码与“在线 html 编辑器”完美配合,但不在我的文件中。

我可以使用 iframe 选项并且它可以工作(

<iframe data-gapiattached="true" frameborder="0" scrolling="no" height="25px" width="174px" style="padding-right: 10px"
  src="http://www.youtube.com/subscribe_embed?bsv&amp;usegapi=1&amp;channel=Youtube">
</iframe></h6>
<script src="https://apis.google.com/js/plusone.js"></script>

) 但我想使用“完整布局”,我想知道为什么我不能使用任何基于 jscript 的按钮,比如 facebook“like”——只有 iframe。

对新手有什么建议吗?;)

4

1 回答 1

2

I am running a html5 file from hard drive

This is your problem. Run it over HTTP instead. Install a local webserver if need be.

于 2013-09-21T08:10:13.920 回答