为什么我不能将iframe嵌入到TinyMCE中?

时间:2015-05-22 04:13:42

标签: tinymce

我已尝试过各种方式,只需将youtube中的嵌入iframe粘贴到我的TinyMCE编辑器的嵌入窗口中,就会导致以下代码无法在浏览器中呈现或正常工作。

说实话,我甚至不确定输出的垃圾是什么?

TinyMCE输出:

<p><img class="mce-object mce-object-iframe" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" width="560" height="315" data-mce-p-src="https://www.youtube.com/embed/GQ2BXqST758" data-mce-object="iframe" data-mce-selected="1"></p><div id="mceResizeHandlen" data-mce-bogus="all" class="mce-resizehandle" unselectable="true" style="cursor: n-resize; margin: 0px; padding: 0px; left: 272px; top: 4.5px;"></div><div id="mceResizeHandlee" data-mce-bogus="all" class="mce-resizehandle" unselectable="true" style="cursor: e-resize; margin: 0px; padding: 0px; left: 539.5px; top: 272px;"></div><div id="mceResizeHandles" data-mce-bogus="all" class="mce-resizehandle" unselectable="true" style="cursor: s-resize; margin: 0px; padding: 0px; left: 272px; top: 539.5px;"></div><div id="mceResizeHandlew" data-mce-bogus="all" class="mce-resizehandle" unselectable="true" style="cursor: w-resize; margin: 0px; padding: 0px; left: 4.5px; top: 272px;"></div><div id="mceResizeHandlenw" data-mce-bogus="all" class="mce-resizehandle" unselectable="true" style="cursor: nw-resize; margin: 0px; padding: 0px; left: 4.5px; top: 4.5px;"></div><div id="mceResizeHandlene" data-mce-bogus="all" class="mce-resizehandle" unselectable="true" style="cursor: ne-resize; margin: 0px; padding: 0px; left: 539.5px; top: 4.5px;"></div><div id="mceResizeHandlese" data-mce-bogus="all" class="mce-resizehandle" unselectable="true" style="cursor: se-resize; margin: 0px; padding: 0px; left: 539.5px; top: 539.5px;"></div><div id="mceResizeHandlesw" data-mce-bogus="all" class="mce-resizehandle" unselectable="true" style="cursor: sw-resize; margin: 0px; padding: 0px; left: 4.5px; top: 539.5px;"></div>

TinyMCE设置

tinymce.init({
            plugins: 'link image code',
            relative_urls: false,
            selector: "textarea",
            content_css : "/static/css/style.css",
            plugins : "media",
            media_poster: false,
            media_strict: false,
            // theme_advanced_buttons1_add : "media",
            theme_advanced_buttons1: "code",
            extended_valid_elements : "iframe[src|width|height|name|align]"
        });

有没有人知道我在这里做错了什么?

0 个答案:

没有答案