du0204
2019-07-16 17:50
浏览 347
已采纳

无法在wordpress页面中加载iframe

I have been trying to load an section of page using iframe in my wordpress site. I can load certain sites in the iframe without any issue but while i try my required page it doesn't work as expected just inside the page. The iframe src is loading perfectly if its opened individually

I have tried most of the answers mentioned here in stackoverflow and other forums, still can't get a solution for this. I tried adding code in .htaccess, also tried adding code in functions.php

This is the iframe src I want to load.

It can be loaded individually in browser but not inside an iframe. I am getting the following error in console while i try to load it :

[ERROR] Permission denied to access property "hash" on cross-origin object

Is this an issue with my code, server config or with the URL itself?

Thanks

图片转代码服务由CSDN问答提供 功能建议

我一直在尝试使用中的 iframe 加载一部分页面 wordpress 网站。 我可以在 iframe 中加载某些网站而不会出现任何问题,但是当我尝试我所需的页面时,它在页面内部无法正常工作。 iframe src如果单独打开则完全加载

我已经尝试了 stackoverflow 和其他论坛中提到的大部分答案, 仍然无法得到解决方案。 我尝试在 .htaccess 中添加代码,也尝试在 functions.php中添加代码

这是我要加载的 iframe src

它可以在浏览器中单独加载,但不能在 iframe 中加载。 我在尝试加载它时在控制台中收到以下错误:

[错误]在跨源对象上访问属性“hash”的权限被拒绝

这是我的代码,服务器配置还是URL本身的问题?

谢谢

  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • douxiong3245 2019-07-17 09:11
    已采纳

    It's about your source is blocking unauthorization call from domains not in CORS. They're only allow call from Origin https://ec.europa.eu. The short answer, you can't deal anything from your side.

    CORS

    More information about CORS: https://developer.mozilla.org/en/docs/Web/HTTP/Access_control_CORS

    打赏 评论

相关推荐 更多相似问题