3

I am trying to implement Rich text 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.

vamsivanka
  • 792
  • 7
  • 16
  • 36

3 Answers3

2

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.

lithorus
  • 623
  • 3
  • 7
2

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.

Eli Grey
  • 35,104
  • 14
  • 75
  • 93
2

Use <html:iframe src="URL to your editor"> is the easiest way to do it

Tuan Anh Hoang-Vu
  • 1,994
  • 1
  • 21
  • 32