Google uses AI technology to translate content into your preferred language. AI translations can contain errors.
概览
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
借助 YouTube Subscribe Button,您可以向任何网页添加 Subscribe 按钮。此按钮会链接到 YouTube 频道。点击该按钮后,系统会在新窗口中打开 YouTube 频道页面,以便用户确认订阅。
要添加此按钮,您的应用程序需要加载以下 JavaScript文件:
https://apis.google.com/js/platform.js
然后,您可以使用某个元素(例如 <div>)添加按钮,该元素将其 class 设置为 g-ytsubscribe,并使用其他属性自定义按钮。以下代码展示了一个简单的集成,用于显示 GoogleDevelopers 频道的 Subscribe 按钮。
<script src="https://apis.google.com/js/platform.js"></script>
<div class="g-ytsubscribe" data-channel="GoogleDevelopers"></div>
您也可以使用 Google+ JavaScript API 来动态呈现按钮。
配置选项
以下按钮显示了订阅按钮的不同布局和配置选项。标准频道的按钮会显示订阅人数,也可能不显示。
默认的按钮语言为用户使用的语言,或根据未登录用户的所在位置进行设置。
标准频道
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-21。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-21。"],[],[]]