I am creating a very simple WYSWIG editor for div s contenteditable = "true". I use execCommandfor simple formatting, for example, bold, italics and underline along with text alignment.
PROBLEM: Bold, italics, underline everything, but using justifyCenter(or any excuse) doesn't work in Firefox, but works in Chrome and Safari. Chrome and Safari don't seem to like my justifyRight, but they work just fine with justifyLeft and justifyCenter. In Firefox, I get the following:
uncaught exception: [Exception ... "Returned component failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMNSHTMLDocument.execCommand]" nsresult: "0x80004005 (NS_ERROR_FAILURE)"
I can’t understand what’s wrong, but I wonder if this could have something to do with the designMode that should be installed in Firefox? However, bold, italics and underline work fine, without me designMode is explicitly included.
Any ideas? Thanks in advance.
source
share