【发布时间】:2013-06-16 12:58:13
【问题描述】:
我怎样才能在右上角有类似这个网站 (http://atomsforpeace.info/) 的订阅计数器按钮?
【问题讨论】:
-
我想知道为什么我对此投了反对票(也许有人不喜欢这个乐队?!;P)
标签: youtube-api youtube-javascript-api
我怎样才能在右上角有类似这个网站 (http://atomsforpeace.info/) 的订阅计数器按钮?
【问题讨论】:
标签: youtube-api youtube-javascript-api
这不是正确的嵌入代码。应该是
<div class="g-ytsubscribe" data-channel="CHANNELNAME"></div>
<script src="https://apis.google.com/js/plusone.js"></script>
在此处阅读更多信息iframe www.youtube.com/subscribe_embed? google plus
【讨论】:
查看他们页面的源代码可以得到他们使用过的代码:
<iframe frameborder="0" hspace="0" marginheight="0" marginwidth="0" scrolling="no" style="position: static; top: 0px; width: 147px; margin: 0px; left: 0px; visibility: visible; height: 24px;" tabindex="0" vspace="0" width="100%" src="https://www.youtube.com/subscribe_embed?bsv&usegapi=1&channel=[YOUR CHANNEL NAME HERE]&theme=dark&hl=en-US&origin=http%3A%2F%2F[YOUR HOSTNAME HERE]&ic=1&jsh=m%3B%2F_%2Fscs%2Fapps-static%2F_%2Fjs%2Fk%3Doz.gapi.en.Hm9QrP5wPuw.O%2Fm%3D__features__%2Fam%3DEQ%2Frt%3Dj%2Fd%3D1%2Frs%3DAItRSTOJmMfO7AjAhJbN5yM-BshnzKg53Q#_methods=onPlusOne%2C_ready%2C_close%2C_open%2C_resizeMe%2C_renderstart%2Concircled%2Conload&id=I0_1371683853533&parent=http%3A%2F%2F[YOUR HOSTNAME HERE]&rpctoken=33681162" data-gapiattached="true"></iframe>
(确保替换 [YOUR CHANNEL NAME HERE] 和 [YOUR HOST NAME HERE] 块)
【讨论】: