CKEditor.insertHtml将div的内容从任何内容改为img

时间:2010-09-21 00:53:17

标签: javascript ckeditor

var content = window.frames[i].document.getElementById("embed").value;

/*
content is: '<object width="480" height="385"><param name="movie"
value="http://www.youtube.com/v/mmYVsGa-uZ0?fs=1&amp;hl=en_US"></param><param
name="allowFullScreen" value="true"></param><param
name="allowscriptaccess" value="always"></param><embed
src="http://www.youtube.com/v/mmYVsGa-uZ0?fs=1&amp;hl=en_US"
type="application/x-shockwave-flash" allowscriptaccess="always"
allowfullscreen="true" width="480" height="385"></embed></object>'
*/

editor.insertHtml('<div class="media_embed">'+content+'</div>');

div的内容变为img,src =“... ckeditor / images / spacer.gif?t = A73H4HC”

有些东西似乎拦截insertHtml函数并用img替换传递的div的内容......这意味着我不能嵌入除图像之外的任何内容!

由于

1 个答案:

答案 0 :(得分:1)