FireFox对TABLE中各元素的firstChild属性的处理(续)

简介: 听说HTML 5.0已经有一段时间了,但是并不知道它到底做了什么改进,这两天就看了下Specification,发现了下面一段话: The markup snippet at the top of this section would be turned into the fol...

听说HTML 5.0已经有一段时间了,但是并不知道它到底做了什么改进,这两天就看了下Specification,发现了下面一段话:

The markup snippet at the top of this section would be turned into the following DOM tree:

  • DOCTYPE: html
  • html
    • head
      • #text : ⏎␣␣
      • title
        • #text : Sample page
      • #text : ⏎␣
    • #text : ⏎␣
    • body
      • #text : ⏎␣␣
      • h1
        • #text : Sample page
      • #text : ⏎␣␣
      • p
        • #text : This is a
        • a href ="demo.html "
          • #text : simple
        • #text : sample.
      • #text : ⏎␣␣
      • #comment : this is a comment
      • #text : ⏎␣⏎

才发现在两个节点中插入一个#text节点是HTML5.0的标准,并不是只针对Table的特殊情况。先BS一下自己孤陋寡闻,继续努力!

由于Firefox 3.5支持HTML5.0,就写了一个简单的程序进行测试,验证了一下:

<html> <head> <title>Test HTML5.0</title> </head> <body> <div id="div1"> <span>ddd</span> </div> <p>This is a test program for HTML5.0.</p> <input type="button" value="test" onClick="testP()"> <script language="javascript"><!-- function testP(){ alert(document.body.firstChild.nodeName);//#text alert(document.getElementById('div1').firstChild.nodeName); //#text } // --></script> </body> </html>

目录
相关文章
|
Web App开发 前端开发 测试技术
|
Web App开发 JavaScript 前端开发
|
Web App开发 前端开发
IE支持而Firefox不支持的CSS属性
今天,居然发现了一个IE支持,而Firefox确不支持的CSS属性。 .peopleBox a { text-indent:-999px; } 测试的时候,发现IE下表现良好,但是Firefox确无动于衷。
697 0
|
Web App开发 JavaScript 前端开发
FireFox对TABLE中各元素的firstChild属性的处理
前几天测试一个小程序,其中需要获取表格中某行第一个单元格自定义的属性值,很自然地就用到: tr.firstChild.getAttribute('bill_id'); 这行代码在IE6上可以正确执行,但是在FireFox3.5上却没有结果。
738 0
|
Web App开发 Linux 数据安全/隐私保护
Docker本地部署Firefox火狐浏览器并远程访问
Docker本地部署Firefox火狐浏览器并远程访问
1461 0
|
3月前
|
Web App开发 搜索推荐 安全
火狐(Mozilla Firefox)浏览器安装教程,附火狐(Mozilla Firefox)安装包
火狐浏览器2025年8月最新版141.0.2发布,支持Windows、Mac、安卓系统,运行速度快,安全性高。提供离线安装包下载,支持多种网络标准,个性化定制功能丰富,安装简便,可自定义安装路径并恢复上次浏览标签,带来更流畅上网体验。
1243 6
|
Web App开发 JavaScript 前端开发
添加浮动按钮点击滚动到网页底部的纯JavaScript演示代码 IE9、11,Maxthon 1.6.7,Firefox30、31,360极速浏览器7.5.3.308下测试正常
添加浮动按钮点击滚动到网页底部的纯JavaScript演示代码 IE9、11,Maxthon 1.6.7,Firefox30、31,360极速浏览器7.5.3.308下测试正常
|
10月前
|
Web App开发 安全 前端开发
一个接口4个步骤轻松搞定最新版Chrome、Edge、Firefox浏览器集成ActiveX控件
目前的浏览器市场,谷歌浏览器占据了半壁江山,因此,谷歌也是最有话语权的,2015年开始取消支持 NPAPI 插件,2022 年10月停止支持 PPAPI 插件;而曾经老大哥IE浏览器也已停止服务,退出历史舞台,导致大量曾经安全、便捷的ActiveX控件无法使用。为了解决这个难题,本人特研发出allWebPlugin中间件,重新让所有ActiveX控件能在谷歌、火狐等浏览器使用。
|
Web App开发 安全 Linux
Linux系统之安装Firefox浏览器
【7月更文挑战第8天】Linux系统之安装Firefox浏览器
772 10