Substitute techniques for "document.execCommand"
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).
精彩评论