如何在 XUL 应用程序中使用富文本编辑器

发布于 2024-08-15 03:47:02 字数 222 浏览 4 评论 0原文

我正在尝试实现富文本编辑器,例如 http://tinymce.moxiecode.com/ 对于我的 XUL 应用程序。看起来我无法使用tinymce,因为它的一些脚本正在使用元素“document.body”,而firefox不支持它。有没有在 XUL 中实现富文本编辑器。请告诉我。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

余厌 2024-08-22 03:47:02

这并不是说 Firefox 不支持 document.body。 document 根据您拥有的文档类型而有所不同。在 HTML 中,您有 document.body,因为 HTML 文档总是有 元素。 XUL 没有 ,因此文档自然没有 document.body 属性。

问题是 TinyMCE 严重依赖于 HTML 文档。我不知道 TinyMCE 的代码,但我怀疑它也可以修改为支持 XUL。

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.

赠佳期 2024-08-22 03:47:02

使用 TinyMCE 的 HTML 是最简单的方法。更难但可能更好的方法是在文档中包含 标记并分配 document.body到那个元素。

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.

云归处 2024-08-22 03:47:02

使用 是最简单的方法

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文