How to use Rich Text editor for an XUL application
I am trying to implement Rich tex开发者_开发知识库t editor like http://tinymce.moxiecode.com/ for my XUL application. It looks like i can't user tinymce as some of its scripts is using the element "document.body" and firefox is not supporting it. Did any implement a rich text editor in XUL. Please let me know.
It's not that firefox doesn't support document.body. document
is different depending on what kind of document you have. In HTML you have document.body
because an HTML document will always have a <BODY>
element. XUL doesn't have a <BODY>
so it's natural that the document doesn't have a document.body
property.
The problem is that TinyMCE is heavily depending on that the document is HTML. I don't know the code for TinyMCE but I would suspect that it can be modified to support XUL as well.
An HTML <frame>
with TinyMCE is the easiest way to go about it. The harder but possibly better way would be to include a <body xmlns="http://www.w3.org/1999/xhtml"/>
tag in the document and assign document.body to that element.
Use <html:iframe src="URL to your editor">
is the easiest way to do it
精彩评论