FF compatible for IE attribute contentEditable

Discussion in 'HTML' started by Dung Ping, Sep 24, 2005.

  1. Dung Ping

    Dung Ping Guest

    The contentEditable is an IE-only attribute. It dosen't work on other
    browsers. But it is said FF has a compaitable attribute with a
    different name. How can I find out what the name is? Thanks.

    Dung Ping
     
    Dung Ping, Sep 24, 2005
    #1
    1. Advertising

  2. Dung Ping

    Toby Inkster Guest

    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
     
    Toby Inkster, Sep 25, 2005
    #2
    1. Advertising

  3. Dung Ping

    Dung Ping Guest

    Thanks for help. I have some questions about the FF sample.
    Toby Inkster wrote:
    >
    > 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>


    In above line, is the word 'data' mandatory? What does the
    Blah%20%3Cb%3Eblah%3C%2Fb%3E stand for? I know the the percentage
    symbol plus a number stands for something, but don't remeber what.

    Thanks again.
    Dung Ping


    > <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
     
    Dung Ping, Sep 25, 2005
    #3
  4. Dung Ping

    Toby Inkster Guest

    Dung Ping wrote:
    > Toby Inkster wrote:
    >
    >> <iframe id="myelement"
    >> src="data:Blah%20%3Cb%3Eblah%3C%2Fb%3E"></iframe>

    >
    > In above line, is the word 'data' mandatory? What does the
    > Blah%20%3Cb%3Eblah%3C%2Fb%3E stand for? I know the the percentage
    > symbol plus a number stands for something, but don't remeber what.


    IFRAME needs a SRC attribute to tell it where to get its contents.

    Normally the source attribute will be "http://...something...", but could
    also be "ftp://...something..." or "gopher://...something...". Basically
    these are different URL-schemes, which indicate to the browser it should
    recieve the file in different ways: using Hyper-Text Transfer Protocol,
    using File Transfer Protocol, using Gopher, etc.

    In this example, I've chosen to use "data:...something...". This tells the
    browser it should retrieve the file by continuting to read the URL.

    In this case, it will read:

    Blah <b>blah</b>

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
     
    Toby Inkster, Sep 25, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?RGFuaWVs?=

    div contenteditable?

    =?Utf-8?B?RGFuaWVs?=, Oct 11, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    2,227
    =?Utf-8?B?RGFuaWVs?=
    Oct 11, 2005
  2. Trevor

    contentEditable

    Trevor, Aug 26, 2005, in forum: HTML
    Replies:
    3
    Views:
    2,207
    Jonathan N. Little
    Aug 27, 2005
  3. Dung Ping

    Entering in contentEditable area

    Dung Ping, Sep 22, 2005, in forum: HTML
    Replies:
    0
    Views:
    399
    Dung Ping
    Sep 22, 2005
  4. Michael Richter

    contenteditable

    Michael Richter, Dec 7, 2005, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    189
    Michael Richter
    Dec 7, 2005
  5. pantagruel
    Replies:
    0
    Views:
    260
    pantagruel
    Feb 17, 2006
Loading...

Share This Page