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

无法在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

  • 写回答

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

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

    报告相同问题?

    悬赏问题

    • ¥15 网络打印机Ip地址自动获取出现问题
    • ¥15 求局部放电案例库,用于预测局部放电类型
    • ¥100 QT Open62541
    • ¥15 stata合并季度数据和日度数据
    • ¥15 谁能提供rabbitmq,erlang,socat压缩包,记住版本要对应
    • ¥15 Vue3 中使用 `vue-router` 只能跳转到主页面?
    • ¥15 用QT,进行QGIS二次开发,如何在添加栅格图层时,将黑白的矢量图渲染成彩色
    • ¥50 监控摄像头 乐橙和家亲版 保存sd卡的文件怎么打开?视频怎么播放?
    • ¥15 Python的Py-QT扩展库开发GUI
    • ¥60 提问一下周期性信信号的问题