开发者

Substitute techniques for "document.execCommand"

开发者 https://www.devze.com 2023-02-27 09:37 出处:网络
I am currently working on a WYSIWYG web editor using only Jquery and CSS. I was sort of annoyed by the inconsistencies of execCommand across all browsers.

I am currently working on a WYSIWYG web editor using only Jquery and CSS.

I was sort of annoyed by the inconsistencies of execCommand across all browsers.

Is there another technique you can achieve开发者_JAVA技巧 something similar to execCommand does. Such a detecting highlighted text and change its CSS settings?

If someone could inspire me with the right direction I really appreciate


For applying a CSS class to a range or selection, you can use my Rangy library and its CSS class applier module (demo). I'm also working on a replacement for document.execCommand() built on Rangy but that's in the fairly early stages at the moment (bold demo).

0

精彩评论

暂无评论...
验证码 换一张
取 消