[whatwg] What exactly is contentEditable for?
ian at hixie.ch
Tue Aug 23 17:10:40 PDT 2005
On Mon, 15 Aug 2005, Matthew Raymond wrote:
> > This is really useful for CMS'es and other kind of editors - template
> > editing and so on.
> Not too familiar with CMSes. Can you give a short use case. It would be
> very helpful.
Wikipedia is the canonical example at the moment.
> > contentEditable is quite clean since you just toggle an attribute.
> | <textarea usehtml readonly><p>...Contents...</p></textarea>
> Just toggle |readonly|...
The content isn't in a <textarea> originally. It's just a Web page.
(Unless you're suggesting that all of Wikipedia should be wrapped in
<textarea> tags, which I don't think would be optimal.)
> > Also consider that editable areas may contain non-editable islands
> > which aganin may contain editable areas. How would that be expresses
> > using TEXTAREA ?
> Is that even handled by |contenteditable| in its current incarnation?
> > Certainly the IE implementation (which is the only non-beta
> > implementation i know of) has its issues, but I dont see how its
> > "conceptually broken". Its very useful, despite its shortcomings.
> Here's how it's conceptually broken: How do you submit the edited
> content without scripting?
You don't. But then you can't enable the editing without scripting in the
first place. I don't see a problem with requiring scripting here. It's
only a line or two anyway:
onsubmit="content.value = document.getElementById('editor').innerHTML">
> How do you edit the content in a legacy browser?
The primary legacy browser supports contentEditable. In older browsers,
you can't edit the content. (But you can still view it. Also, since we're
requiring JS anyway, you could easily provide fallback to a <textarea> in
legacy UAs, although that's suboptimal since it relies on authors).
Ian Hickson U+1047E )\._.,--....,'``. fL
http://ln.hixie.ch/ U+263A /, _.. \ _\ ;`._ ,.
Things that are impossible just take longer. `._.-(,_..'--(,_..'`-.;.'
More information about the whatwg