本文介绍了强制浏览器插入< p>在设计模式IFrame中按Enter时标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在浏览器中插入< p> 标签而不是< br> 标签按键在 designMode IFrame?我在Firefox,Chrome和IE浏览器中遇到了不一致的行为,并且想知道是否有一些方法来规范化它。

解析方案

不能。行为不规范,对此的控制是最基本的

这是一个有趣的话题,从5月份开始,在这件事上:。它讨论contenteditable而不是designMode,但它们实际上非常相似。



线程中的一封电子邮件( by Markus Ernst包括这个评论:

关于各种浏览器制造商认为应该发生什么的人,关于一些非常奇怪的现有行为的评论以及一般性讨论关于实现它所涉及的问题。



目前所有这些alpha规范都在


How can I make the browser insert <p> tags instead of <br> tags when I press enter in a designMode IFrame? I get inconsistent behavior across Firefox, Chrome and IE and was wondering if there was some way to normalize this.

解决方案

It seems you can't. Behaviour is not standardized and control for this is rudimentary at best

This is an interesting thread from May thie year on the matter: http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2011-May/031577.html . It's discussing contenteditable rather than designMode but they're effectively very similar.

An email on the thread ( http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2011-May/031604.html ) from Simon Pieters (zcorpan) of Opera says:

Further in the thread there's also this email http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2011-May/031685.html by Markus Ernst including this comment:

There's lots more on the thread about what people at the various browser makers think ought to happen, comments on some very strange existing behaviours, and general discussion about the problem involved in implementing it at all.

The currently very alpha spec for all this is at http://aryeh.name/spec/editing/editing.html

这篇关于强制浏览器插入&lt; p&gt;在设计模式IFrame中按Enter时标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 04:48