js 取行
来源:互联网 发布:销售数据分析表格 编辑:程序博客网 时间:2024/06/06 03:30
留下看看
var stafferList1 = parent.frame1.document.getElementById("stafferList");
var stafferList2 = parent.frame2.document.getElementById("stafferList");
if(stafferList1 && stafferList2){
for(var i=0;i<stafferList1.rows.length;i++){
if(stafferList1.rows.item(i).cells.length != stafferList2.rows.item(i).cells.length){
for(var j=0;j<stafferList1.rows.item(i).cells.length;j++ ){
stafferList1.rows.item(i).cells.item(j).style.backgroundColor = "yellow";
}
for(var j=0;j<stafferList2.rows.item(i).cells.length;j++ ){
stafferList2.rows.item(i).cells.item(j).style.backgroundColor = "yellow";
}
continue;
}
var strTrue = false;
for(var j=0;j<stafferList1.rows.item(i).cells.length;j++ ){
var value1=stafferList1.rows.item(i).cells.item(j).innerText;
var value2=stafferList2.rows.item(i).cells.item(j).innerText;
if(value1 != value2){
strTrue = ture;
}
}
if(strTrue){
for(var j=0;j<stafferList1.rows.item(i).cells.length;j++ ){
stafferList1.rows.item(i).cells.item(j).style.backgroundColor = "yellow";
}
for(var j=0;j<stafferList2.rows.item(i).cells.length;j++ ){
stafferList2.rows.item(i).cells.item(j).style.backgroundColor = "yellow";
}
}
}
}
var scheduleList1 = parent.frame1.document.getElementById("scheduleList");
var scheduleList2 = parent.frame2.document.getElementById("scheduleList");
if(scheduleList1 && scheduleList2){
for(var i=0;i<scheduleList1.rows.length;i++){
if(scheduleList1.rows.item(i).cells.length != scheduleList2.rows.item(i).cells.length){
for(var j=0;j<scheduleList1.rows.item(i).cells.length;j++ ){
scheduleList1.rows.item(i).cells.item(j).style.backgroundColor = "yellow";
}
for(var j=0;j<scheduleList2.rows.item(i).cells.length;j++ ){
scheduleList2.rows.item(i).cells.item(j).style.backgroundColor = "yellow";
}
continue;
}
var strTrue = false;
for(var j=0;j<scheduleList1.rows.item(i).cells.length;j++ ){
var value1=scheduleList1.rows.item(i).cells.item(j).innerText;
var value2=scheduleList2.rows.item(i).cells.item(j).innerText;
if(value1 != value2){
strTrue = true;
}
}
if(strTrue){
for(var j=0;j<scheduleList1.rows.item(i).cells.length;j++ ){
scheduleList1.rows.item(i).cells.item(j).style.backgroundColor = "blue";
}
for(var j=0;j<scheduleList2.rows.item(i).cells.length;j++ ){
scheduleList2.rows.item(i).cells.item(j).style.backgroundColor = "blue";
}
}
}
}
1 var trElement = document.createElement("tr");
2 var tdElement = document.createElement("td");
3 tdElement.colSpan = 6;
4 tdElement.innerHTML = "没有在线用户";
5 trElement.appendChild(tdElement);
6 var tBody = document.getElementById("mytBodyId");
7 tBody.appendChild(trElement);
第3行,很多人会写成tdElement.colspan = 6;,是无效的。
第2行,很多人会写成trElement.innerHTML = "《td colspan=6》没有在线用户《/td》";,是无效的。
第4行,是没问题的,也可以再创建一个文本节点然后用tdElement.appendChild()添加。
第7行,很多人会写成tBody.innerHTML = "《tr》《td colspan=6》没有在线用户《/td》《/tr》";,是无效的.
- js 取行
- js 取模 取余
- js取整数、取余数
- js取时间
- JS函数取字符串
- JS取MAC
- jS+Webservice取数据
- js取网页源码
- JS取整
- js取整数四舍五入
- js取url参数
- js 取控件坐标
- JS 取 URL参数
- JS讀取XML
- js取url值
- js 取值问题
- js取Request值
- js 取元素属性
- Fedora 10 以root登陆的解决办法
- SQL server 中的三个重要对象
- 平庸和优秀的距离,我要得不仅仅是土豆
- float格式简谈 以及自己编写的一段读写浮点数的代码
- 今天开博
- js 取行
- SQL Server 2005 数据库对象命名规范 Database Naming Conventions(Guidelines)
- 程序设计中的一些感悟
- 最简单的编辑器 ed----转载
- 一份C/C++实习生笔试试卷(基础部分 )
- 2009年3月16日,博客更新公告!
- VS2005中远程调试的配置方法
- 基于FireFox的测试插件—Selenium IDE
- 安装SQL 2005中的AdventureWorks数据库