我尝试在JSF页面中使用CKEditor,例如:
<pe:ckEditor id="editor" value="#{messagingController.messageContent}" width="600"/>该编辑器将出现在中,而不是在Fire或Chrome中
FireBug向我显示了以下错误:
SyntaxError: An invalid or illegal string was specifiedChrome控制台显示了以下错误:
Uncaught SyntaxError: Failed to set the 'innerHTML' property on 'Element':
The provided markup is invalid XML, and therefore cannot be inserted into an XML document.
CKEDITOR.plugins.add.afterInit
(anonymous function)
k
CKEDITOR.scriptLoader.load
(anonymous function)
(anonymous function)
(anonymous function)
k
CKEDITOR.scriptLoader.load
CKEDITOR.resourceManager.load
i
(anonymous function)
k
(anonymous function)
(anonymous function)
(anonymous function)
k
l
o
(anonymous function)这是虫子什么的吗?我可以用其他方式包括这个组件吗?
我还使用了最新的primefaces扩展库:
<groupId>org.primefaces.extensions</groupId>
<artifactId>primefaces-extensions</artifactId>
<version>3.0.0</version>发布于 2014-11-30 14:19:54
问题在于我的页面的mime类型!当我将它从application/xhtml+xml改为text/html时,问题就解决了。
发布于 2016-05-12 05:44:55
在已经正确的答案中添加了少量内容:
同样在iOS Safari中,这个语法错误可能会出现。一个指示是您的文档变量compatMode:"CSS1Compat" (在js中),那么ckEditor将在这个函数x.innerHTML = "some string with html entities"上导致一个错误,因为文档读取时使用了错误的mime类型。
当文档中有ckEditor时,compatMode:"BackCompat"可以很好地工作。这由浏览器设置,并取决于内容类型resp。媒体类型的。
https://stackoverflow.com/questions/27213606
复制相似问题