Cross-Browser Rich Text Editor

Tuesday April 1st, 2003

Kevin Roth wrote in to tell us that he has "created a cross-browser rich-text editor incorporating the new Midas API included with Mozilla version 1.3. Source code is available for download."

#10 IE specific code

by adipose

Wednesday April 2nd, 2003 11:14 PM

You are replying to this message

This can actually work w/o the IE specific code. I changed the designmode function to look like this:

function enableDesignMode() { frames.edit.document.designMode = "On"; }

The "frames." is unecessary as well. In any case, this will work on both Moz. and IE, which makes it a bit easier on web-site designers. Unfortunately, the mozilla specific code doesn't work on IE. It *should* work, but for some reason the "getElementByID" combined with the "designMode" seems to fail (on IE). Therefore, "edit.document.designMode" works, but "document.getElementById('edit').document.designMode" doesn't (doesn't work with 'contentDocument' either). "edit" should be the same as "document.getElementByID('edit')" but in this case it's not for some reason.

Luckily Moz works with the IE code, so the function above works on both. :)