2

我使用 Firefox + Firebug 并尝试停止错误消息...

Error: Permission denied to access property 'toString'

在 Chrome 中说..

Unsafe JavaScript attempt to access frame with URL http://jsfiddle.net/PEaUD/ from frame with URL http://www.youtube.com/embed/zTFBJgnNgU4?rel=0&showinfo=0&autohide=1&controls=0. Domains, protocols and ports must match.

我只是使用 jQuery 之类的东西......

$("body").html('<iframe width="500" height="500" src="http://www.youtube.com/embed/zTFBJgnNgU4?rel=0&showinfo=0&autohide=1&controls=0" frameborder="0" allowfullscreen></iframe>');

演示:http: //jsfiddle.net/PEaUD/

有什么问题?

我们无法修复它,因为... https://stackoverflow.com/a/13101119/622813

PS:我问是因为在 Firefox 中出现此错误时,我无法播放 youtube 视频,单击 play-btn 时无法在 url 栏中键入/复制/传递(通过键盘)任何内容。

4

1 回答 1

3

如果您使用 youtube player api 加载视频,您将不会收到该特定错误

https://developers.google.com/youtube/js_api_reference

我希望这有帮助。

于 2013-02-04T11:53:25.830 回答