问题描述
我认为这与目标来源有关https
。我怀疑是因为您使用的是iFrame网址,http
而不是https
。尝试更改要嵌入为的文件的urlhttps
。
例如:
'//www.youtube.com/embed/' + id + '?showinfo=0&enablejsapi=1&origin=http://localhost:9000';
成为:
'https://www.youtube.com/embed/' + id + '?showinfo=0&enablejsapi=1&origin=http://localhost:9000';
解决方法
这是我收到的错误消息:
Failed to execute 'postMessage' on 'DOMWindow': The target origin provided
('https://www.youtube.com') does not match the recipient window's origin
('http://localhost:9000').
我看到了其他类似的问题,其中目标的原点是http://www.youtube.com
和接收者的原点是https://www.youtube.com
,而我的目标https://www.youtube.com
和目标的原点是http://localhost:9000
。
- 我没问题。问题是什么?
- 我该如何解决?