不允许的关键字符.通过 Codeigniter 中的 jQuery 在帧中加载嵌入代码时出错

Disallowed Key Characters. error while loading embed code in frame through jquery in codeigniter?

本文关键字:加载 出错 代码 jQuery 字符 通过 中的 Codeigniter 不允许      更新时间:2023-09-26

我通过jQuery在iframe中加载我的嵌入代码,如下所示

<div id="My-page" style="width:900px; height:900px; position: absolute;overflow-x:hidden !important;-webkit-overflow-scrolling:touch !important;" class="iframely-widget-container">
    <script>
        $("#My-page").empty().append($("<iframe/>", {
            src: "http://localhost/flipbeets3.0.com/get-embedded-code/abdul/p~2~2~2?slug-hash=HrFBx&amp;default-tab=result&amp;host=http%3A%2F%2Fcodepen.io"
        }));
    </script>
</div>

它显示不允许的关键字符错误

当您通过javascript加载URL时,无需对其进行编码。此代码应该适合您:

<div id="My-page" style="width:900px; height:900px; position: absolute;overflow-x:hidden !important;-webkit-overflow-scrolling:touch !important;" class="iframely-widget-container"></div><script>$("#My-page").empty().append($("<iframe/>", {src: "http://localhost/flipbeets3.0.com/get-embedded-code/abdul/p~2~2~2?slug-hash=HrFBx&default-tab=result&host=http://codepen.io"}));</script>