从HTML到DOM转换回HTML是否标准化? [英] Is the conversion from HTML to DOM and back to HTML standardized?

查看:113
本文介绍了从HTML到DOM转换回HTML是否标准化?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究将使用ContentEditable的富文本编辑器。加载到浏览器中的文档(来自Web服务器)不得以任何方式被转换为DOM,然后单独转换为HTML(假设用户未做任何更改)。

I'm working on an rich-text editor that will be using ContentEditable. It's imperative that a document that is loaded into the browser (from the web server) is not altered in any way by the conversion to DOM, and then back to HTML alone (assuming the user has not made any changes).

如果HTML文档在第一次被浏览器创建和保存时被修改,但后来不应该再次发生,这只需要所有浏览器根据等效的HTML和基于等效DOM的相同HTML输出。这是我可以依赖的东西吗?

It's alright if the HTML document is modified the first time it's created and saved by a browser, but subsequently should not occur again, which simply requires that all browsers will produce the same DOM based on equivalent HTML, and the same HTML output based on equivalent DOMs. Is this something that I can rely upon?

推荐答案

开始的标记< div id ='mydiv'>< / div> 。在IE9中,变成< div id =mydiv>< / div> 。在IE8中,它变成< DIV id = mydiv>< / DIV>

Take markup that starts as <div id='mydiv'></div>. In IE9 that becomes <div id="mydiv"></div>. In IE8, it becomes <DIV id=mydiv></DIV>

这篇关于从HTML到DOM转换回HTML是否标准化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆