If you are, like me, serving xhtml as application/xhtml+xml to capable browsers, as it should to avoid the famous syndrome of poor/false xhtml, you may have run in trouble, as I did at my first attempt some weeks ago. Without specific adjustment the creation of We fails on Error: NO_MODIFICATION_ALLOWED_ERR: DOM Exception 7.
This time, I dig in more seriously, looked at the test page from SVN, and found that it runs because We creation is enclosed in a try-catch block, which is a small cheat. In fact it fails as it is but only on a marginal point.
So I looked at the error and found the culprit. It's a small bit of code, on line 18 in default skin.js
- Code: Select all
.append("<span> ></span>")
The error is raised from jquery element creation and id due to the >, even if it's specified as >. It should be escaped or something like this.
Strange enough I verified that using
- Code: Select all
.append("<span> ></span>") // the white space is utf-8 non-breaking space
I choose to simply comment the faulty line because it adds only a cosmetic character and I don't need it for my layout (from the modified layout example).
With this line commented out or modified, one can create WYMeditor without try-catch enclosing block, in page served as application/xhtml+xml.