The risk of using contentEditable in IE

We need to add HTML to our main editor. Since we only support IE at this time (most clients are still on IE 6), I was told to use the built-in XHTML editing features in Internet Explorer. <div contentEditable="true"> as described in the "Editing a Web Page " section.

Astronomy does not work in other browsers. (Management does not believe that this is a problem. Our customers will work with our software, working only with IE. We have never lost any money with our software working only in IE, most customers will only allow their employees to use IE6 in any case anyway)

What other problem can we get with contentEditable?




Update

The HTML editor I wrote with "contentEditable" proved to be very difficult to work with many problems reliably. If I had to do it again, I would click very heavy on one of the many open source solutions (like TinyMCE) or buy in a supported HTML editor.

There is no doubt that a very experienced jscript programmer can get "contentEditable" to work well with enough time. It’s just that all the examples on the Internet look so simple until you check out common operations such as cutting / pasting from a word and trying to edit the resulting HTML. (only what the client will do)

(Just search for "contentEditable" in stackoverflow to get some ideal of the problems that other people had)

+22
javascript html internet-explorer contenteditable
Jan 29 '09 at 14:27
source share
6 answers

The contentEditable property works in Safari, Firefox 3, and Opera 9.

Since manipulation will undoubtedly be related to the selection, your biggest problem will be to make the selection / ranges work in browsers ( see here) .

Browsers also have numerous small bugs that may or may not bite you. These include incompatible case sensitivity, incompatible methods to disable it (removeAttribute versus setting to false).

Despite these shortcomings, I believe that this works pretty well.

+11
Jan 30 '09 at 1:17
source share

How to use some open source solution that works in all major browsers?

Tinymce

There are other projects, but what I will use.

+6
Jan 29 '09 at 14:32
source share

HTML 5 includes the contenteditable attribute, so it looks like it will be in IE for a long time to come.

Just received a message from someone from the IE team

Although it is in principle impossible to comment on the future with a high degree of confidence, it is fair to say that I do not know about any plans to remove contentEditable, and if it was deleted, it would break many sites.

+6
Jan 29 '09 at 15:30
source share

A quick Google search has posted some (albeit minor) contentEditable issues.

+2
Jan 29 '09 at 15:56
source share

contentEditable works under Firefox 3. I do not know any problems with contentEditable.

+1
Jan 29 '09 at 2:30 p.m.
source share

I just don’t forget to check what content you will return as inserting XSS attacks is pretty simple in IE if there is no HTML content validation.

+1
Jan 29 '09 at 14:33
source share



All Articles