我们希望在iframe中显示我们网站的博客页面。阅读This我设置了:
<?php /** @package WordPress @subpackage Default_Theme **/
header("Access-Control-Allow-Origin: *");
?>
在标题中设置访问控制。
然而,当我尝试:
<iframe src="https://get10things.com/blog" style="border: 0; width: 100%; height: 100%"></iframe>
我仍然收到错误:
Uncaught DOMException: Blocked a frame with origin "https://get10things.com" from accessing a cross-origin frame.
at https://get10things.com/wp-content/themes/10t2016_v1/js/script.js?201607261750:2:20942
at https://get10things.com/wp-content/themes/10t2016_v1/js/script.js?201607261750:2:20739
at https://get10things.com/wp-content/themes/10t2016_v1/js/script.js?201607261750:2:20772
我做错了什么?