开发者

Firefox and contentEditable spans

开发者 https://www.devze.com 2023-03-04 21:23 出处:网络
I am using a WYSIWYG (InnovaEditor) to edit content on my website, and it works in Chrome, IE, and mostly in Firefox, but FF has a slightly nasty issue. I insert span tags into the content to allow me

I am using a WYSIWYG (InnovaEditor) to edit content on my website, and it works in Chrome, IE, and mostly in Firefox, but FF has a slightly nasty issue. I insert span tags into the content to allow merging content later, such as this:

<span style="background-color:yel开发者_如何转开发low;" 
      subst_key="{Object1.name}" 
      contentEditable="false">
  Object1 Name
</span>

I cannot change the basic format, it is a business project and way too much code relies on it being how it is. The issue is that, even though the span is not editable, FF will sometimes allow character by character deletion - just by pressing backspace after the merge field. Also, even after you delete the content, sometimes the span tag with merge field doesn't get deleted (just the text between open and close)! Any ideas why FF allows editing of non-contentEditable fields?

TL;DR FF occasionally allows editing of contentEditable=false span tag. How do I stop it?


well it seems the contenteditable attribute is just working in ie and some other browsers that support it but in the other browsers there just works with the designmode attribute maybe you have to use some javascript for it http://theocacao.com/document.page/137

but there are also many better wysiwyg editors around like ck editor?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号