html的js代码在ie能正常运行,在谷歌等其他浏览器不兼容 120
该段JS代码如下:<script>vartempRow=0;window.onload=function(){functiongetParameter(param){va...
该段JS代码如下:
<script>
var tempRow=0;
window.onload = function(){
function getParameter(param){
var query = window.location.search;
alert(query);
var iLen = param.length;
var iStart = query.indexOf(param);
if (iStart == -1)
return "";
iStart += iLen + 1;
var iEnd = query.indexOf("&", iStart);
if (iEnd == -1)
return query.substring(iStart);
return query.substring(iStart, iEnd);
}
var flag = getParameter("selectFlg");
switch(flag)
{
case "0":
tempRow=resultList.rows.length-1;
tempRow=tempRow+1;
var Rows=resultList.rows;
var newRow=resultList.insertRow(resultList.rows.length);
var Cells=newRow.cells;
for(var i=0;i<6;i++){
var newCell=Rows(newRow.rowIndex).insertCell(Cells.length);
switch(i)
{
case 0:
newCell.innerHTML="<td>"+getParameter("funcName")+"</td>";
break;
case 1:
newCell.innerHTML="<td>"+getParameter("funcId")+"</td>";
break;
case 2:
newCell.innerHTML="<td>00:02:58</td>";
break;
case 3:
newCell.innerHTML="<td>22</td>";
break;
case 4:
newCell.innerHTML="<td>23</td>";
break;
case 5:
newCell.innerHTML="<td>NG</td>";
break;
}
}
break;
后面的switch分歧省略了
谷歌浏览器自带DEBUG提示:
TypeError: Rows is not a function
下面这行出错了
var newCell=Rows(newRow.rowIndex).insertCell(Cells.length);
求解决方法 展开
<script>
var tempRow=0;
window.onload = function(){
function getParameter(param){
var query = window.location.search;
alert(query);
var iLen = param.length;
var iStart = query.indexOf(param);
if (iStart == -1)
return "";
iStart += iLen + 1;
var iEnd = query.indexOf("&", iStart);
if (iEnd == -1)
return query.substring(iStart);
return query.substring(iStart, iEnd);
}
var flag = getParameter("selectFlg");
switch(flag)
{
case "0":
tempRow=resultList.rows.length-1;
tempRow=tempRow+1;
var Rows=resultList.rows;
var newRow=resultList.insertRow(resultList.rows.length);
var Cells=newRow.cells;
for(var i=0;i<6;i++){
var newCell=Rows(newRow.rowIndex).insertCell(Cells.length);
switch(i)
{
case 0:
newCell.innerHTML="<td>"+getParameter("funcName")+"</td>";
break;
case 1:
newCell.innerHTML="<td>"+getParameter("funcId")+"</td>";
break;
case 2:
newCell.innerHTML="<td>00:02:58</td>";
break;
case 3:
newCell.innerHTML="<td>22</td>";
break;
case 4:
newCell.innerHTML="<td>23</td>";
break;
case 5:
newCell.innerHTML="<td>NG</td>";
break;
}
}
break;
后面的switch分歧省略了
谷歌浏览器自带DEBUG提示:
TypeError: Rows is not a function
下面这行出错了
var newCell=Rows(newRow.rowIndex).insertCell(Cells.length);
求解决方法 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询