4 ms·
I have done extensive research in this area as well - my code is used in production by 100,000 users, by another company. I personally always choose to go with
by marknadal 12y ago
I have done extensive research in this area as well - my code is used in production by 100,000 users, by another company. I personally always choose to go with direct contentEditable without an iframe. It makes things much easier.
However, what the author did not mention was security. My assumption as to why the company that uses my code, still uses it inside an iframe, is to prevent accidental XSS injection from when their user's copy and paste content (sometimes with javascript embedded in it) into the editor. So be careful about that.
Another recommendation I have, is to NOT use execCommand.
- dood 12y agoWhy not use execCommand?
- teleclimber 12y agoI haven't used execCommand in a while but I think it adds a bunch of font tags. Also different browsers will use different tags for "bold" for example (<b> vs <em>) leading to inconsistent markup. Easier to just decide the tags and insert them yourself.