0

I tried to use the CKEditor in a JSF page like:

<pe:ckEditor id="editor" value="#{messagingController.messageContent}" width="600"/>

The editor will appear in Internet Explorer but not in Fire Fox or Chrome
FireBug shows me the following error:

SyntaxError: An invalid or illegal string was specified

And Chrome console shows me the following error:

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)

Is this a bug or something? Can I include this component any other way around?

I also use the latest primefaces extentions lib:

<groupId>org.primefaces.extensions</groupId>
<artifactId>primefaces-extensions</artifactId>
<version>3.0.0</version>
Soosh
  • 812
  • 1
  • 8
  • 24

2 Answers2

0

The problem was with the mime type of my page!when I changed it from application/xhtml+xml to text/html, the problem is solved.

Soosh
  • 812
  • 1
  • 8
  • 24
0

Small addition to the already correct answer:

Also in iOS Safari this Syntax Error can appear. An indication is your document variable compatMode:"CSS1Compat" (in js), then ckEditor will cause an error at this function x.innerHTML = "some string with html entities" because the document is read with the wrong mime type.

ckEditor works fine for me when the document has compatMode:"BackCompat". This is set by the browser and depends on the content-type resp. media-type.

chrissharkman
  • 88
  • 1
  • 9