【发布时间】:2017-08-03 07:22:22
【问题描述】:
所以我一直在尝试使用 YouTube API V3 给我的代码在我的测试网站上添加一个订阅按钮:
<script src="https://apis.google.com/js/platform.js"></script>
<div class="g-ytsubscribe" data-channelid="UCzfStpfCASIjJNK2xMNdJiw" data-layout="full" data-count="default"></div>
但是当我加载页面时,它给了我这些错误:
> Failed to execute 'postMessage' on 'DOMWindow': The target origin
> provided ('file://') does not match the recipient window's origin
> ('null'). cb=gapi.loaded 0:49
> Failed to execute 'postMessage' on 'DOMWindow': The target origin
> provided ('file://') does not match the recipient window's origin
> ('null'). cb=gapi.loaded 0:48
任何帮助将不胜感激!
【问题讨论】:
标签: javascript jquery youtube youtube-data-api