【发布时间】:2014-11-01 00:36:47
【问题描述】:
为什么实体  的长度为6,而实体↓ 的长度为1?这是在规范中的某个地方吗? (在 Firefox、Chrome 和 Safari 中测试。)
【问题讨论】:
-
可能是SGML中规定的,我看看
-
如果我不得不猜测这是一个故意的错误,以保持向后兼容性fileformat.info/info/unicode/char/a0/index.htm 嗯 - 请注意
.textContent在任何一种情况下都会返回 1。 -
有趣...是的,你是对的,它适用于 textContent (JSFiddle)
标签: html unicode innerhtml html-entities string-length