Javascript WYSIWYG 文本区域插件在浏览器中产生不一致的结果?
我需要一个轻量级、基于 Javascript 的所见即所得编辑器,将
美好的。没问题。有很多这样的产品声称可以做到这一点。但奇怪的是:我发现在我使用过的大量编辑器中,它们在不同的浏览器中输出不同的东西! Chrome 会输出 但 Firefox 会输出
?!
例如,尝试在 Chrome 和 Firefox 的这些编辑器中应用粗体:
http://freshcode.co/plugins/jquery.contentEditable/demo.html < /一>
<一href="http://www.gosu.pl/steditor/" rel="nofollow">http://www.gosu.pl/steditor/
http://batiste.dosimple.ch/blog/posts/2007-09-11-1/rich-text-editor-jquery.html
看到了吗? Chrome 中为 ,Firefox 中则为
。诡异的!
有什么想法吗?
I'm in need of a lightweight, Javascript-based, WYSIWYG editor that transforms <textarea>
s into Rich Text Editors. There are thousands of these plugins out there (and I feel like I've demoed them all). For reasons outside of my control, I need the editor to produce legacy HTML... so it needs to write <b>
instead of <strong>
or <span style=...>
.
Fine. No problem. There are plenty of these that purport to do just that. Here's the weirdness though: I'm finding that in a ton of these editors that I've played with, they output different things in different browsers! Chrome will output <b>
but Firefox will output <span style="font-weight:bold">
?!
For example, try applying bold in these editors in both Chrome and Firefox:
http://freshcode.co/plugins/jquery.contentEditable/demo.html
http://batiste.dosimple.ch/blog/posts/2007-09-11-1/rich-text-editor-jquery.html
See? <b>
in Chrome, but <span style="font-weight:bold">
in Firefox. Weird!
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该从最常用的编辑器(如 CKEditor 和 TinyMCE)开始,而不是寻找不太知名的编辑器。
在 CKEditor 中检查此示例:
http://nightly.ckeditor.com/latest/ckeditor/_samples/output_html.html
Instead of searching for the less known editor, you should have started with the most commonly used ones like CKEditor and TinyMCE.
Check this sample in CKEditor:
http://nightly.ckeditor.com/latest/ckeditor/_samples/output_html.html