【发布时间】:2015-12-28 11:51:43
【问题描述】:
我正在努力
这是我的 HTML 中的代码
<iframe class="embed-responsive-item" id="placeYoutubeVideo"
style="display:none" src="#" style="display:none" allowfullscreen></iframe>
在 jQuery 中我正在尝试更改视频的 src
var neww = 'https://youtu.be/NOubzHCUt48';
$('#placeYoutubeVideo').prop('src', neww)
但它抛出以下错误:
拒绝显示 'https://www.youtube.com/watch?v=NOubzHCUt48&feature=youtu.be' 在一个 框架,因为它将“X-Frame-Options”设置为“SAMEORIGIN”。
我该如何解决这个问题?
如果不可能,是否可以通过点击功能生成带有 youtube url 的 iframe?
请帮忙。
【问题讨论】:
-
这可能重复:How to set 'X-Frame-Options' on iframe? 可能会帮助您了解您的问题...
标签: javascript php jquery iframe youtube