You are here: Re: FF compatible for IE attribute contentEditable « HTML « IT news, forums, messages
Re: FF compatible for IE attribute contentEditable

Posted by Toby Inkster on 09/25/05 11:54

Dung Ping wrote:

> The contentEditable is an IE-only attribute. It dosen't work on other
> browsers.

It is proprietry to IE.

> But it is said FF has a compaitable attribute with a different name.

Mozilla 1.4+ and other browsers based on that engine (Netscape 7.1,
Firefox, Ephiphany, etc) do have a similar concept, though it's not
completely compatible. You must set the attribute on a whole document:
not just part of it (though that whole document could be loaded via an
iframe); and it must be set via Javascript.

<iframe id="myelement" src="data:Blah%20%3Cb%3Eblah%3C%2Fb%3E"></iframe>
<script type="text/javascript">
var e = document.getElementById("myelement");
e.contentDocument.designMode="on";
</script>

The easy thing to do it to use a library that smoothes over the
incompatibilities. I can recommend using widgEditor, which can be
downloaded free from http://www.themaninblue.com/experiment/widgEditor/

Of course, all these methods are proprietary and should not be relied upon
for a public website. Always provide a fall-back to a more standards
compliant way of editing the text, such as TEXTAREA; or thinking outside
the box, allow the user to download the file, edit it in a tool of their
choice (be that Word, Notepad, Dreamweaver or Emacs) and then send back
the file using a file upload form.

Looking towards the future, the closest thing to a standard method for
rich text editing that we're likely to see would be Web Applications 1.0,
which is being worked on jointly by Apple Computers Inc, the Mozilla
Foundation and Opera Software ASA. It is quite a way off from
implementation though.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация