我有一个问题,使用tinymce.activeEditor.execCommand('mceInsertContent',
时无法包含base64图像。
以下内容是有效的:
tinymce.activeEditor.execCommand("mceInsertContent", true, "<img style = 'height:80px;width:80px' src='/Content/image.png' />");`
tinymce.activeEditor.execCommand("mceInsertContent", true, "<div>safasfdasfd</div>");
当使用tinymce.activeEditor.execCommand('mceInsertContent', true, img64);
时,其中img64
是从MVC局部视图接收并转换为字符串的base64
图片。
有没有人有一个可行的例子。我不知道语法是否错误或者是否有一些选项我忘记了?
更新:
以下内容不起作用:
tinymce.activeEditor.execCommand("mceInsertContent", true, "<img style='height:80px;width:80px' src='data:image/png;base64,/some long 64 string is here'>");
有人知道为什么这个不起作用吗?非常感谢帮助。
<img src='data......
但是我个人会尽可能把图片发送到服务器并在那里临时存储。 - Pekka