How to use Rich Text Editor for XUL application

I am trying to implement a Rich Text editor, for example http://tinymce.moxiecode.com/ for my XUL application. It seems like I cannot use tinymce, as some of its scripts use the document.body element, and firefox does not support it. Has XUL implemented an advanced text editor? Please let me know.

+3
source share
3 answers

It is not that firefox does not support document.body. documentdiffers depending on which document you have. In HTML you have it document.body, because an HTML document will always have an element <BODY>. XUL does not <BODY>, therefore it is natural that a document has no property document.body.

The problem is that TinyMCE is highly dependent on the fact that the document is HTML. I do not know the code for TinyMCE, but I would suspect that it can be modified to support XUL.

+1
source

HTML <frame>with TinyMCE is the easiest way to do this. A more complex, but perhaps better way would be to include the tag <body xmlns="http://www.w3.org/1999/xhtml"/>in the document and assign document.body to this element.

+1
source

<html:iframe src="URL to your editor"> -

+1
source

Source: https://habr.com/ru/post/1725763/


All Articles