js排序代码不能实现,请帮我看看什么问题
<body><TABLEstyle="TEXT-ALIGN:center;LINE-HEIGHT:25px;WIDTH:990px;FONT-FAMILY:verdana...
<body>
<TABLE
style="TEXT-ALIGN: center; LINE-HEIGHT: 25px; WIDTH: 990px; FONT-FAMILY: verdana"
cellSpacing=1 cellPadding=3 bgColor=#6593b9 align=center>
<TR style="FONT-WEIGHT: bold" bgColor=#c3dcf0>
<TD width=190>走货渠道</TD>
<TD width=115>体积重量</TD>
<TD width=115>结算重量</TD>
<TD width=115>金额(人民币)<font onclick="JavaScript:orderasc(0)" style="cursor: hand">升</font><font onclick="JavaScript:orderasc(1)" style="cursor: hand">降</font></TD>
<TD width=110>币别</TD>
<TD width=115>递送时间</TD>
<TD width=115>计算公式</TD>
<TD width=115>报价备注</TD></TR></TABLE>
<TABLE
style="TEXT-ALIGN: center; LINE-HEIGHT: 25px; WIDTH: 990px; FONT-FAMILY: verdana"
cellSpacing=1 cellPadding=3 bgColor=#6593b9 align=center id="tableid">
<%
sumprice=20
for i=1 to 5
sumprice=sumprice+1%>
<TBODY >
<TR style="FONT-WEIGHT: bold" bgColor=#c3dcf0>
<TD width=190><% =true_name%></TD>
<TD width=115><%=vweight%>kg</TD>
<TD width=115><% =weight%>kg</TD>
<TD width=115><% =sumprice%>元</TD>
<TD width=110><form action="" method="post" >
<select name="money<%=i%>" >
</select></form></TD>
<TD width=115><%=past_time%></TD>
<TD width=115
><a href="JavaScript:void(0)">计算公式</a></TD>
<TD width=115
><a href="JavaScript:void(0)">报价备注</a></TD>
</TR>
<TR style="FONT-WEIGHT: bold;display:none" bgColor=#c3dcf0 >
<TD width=990 colspan="8">asd</TD>
</TR>
<TR style="FONT-WEIGHT: bold;display:none" bgColor=#c3dcf0>
<TD width=990 colspan="8">sfdaf</TD>
</TR>
</TBODY>
<%next%>
</TABLE>
<p> </p>
<p>
<SCRIPT LANGUAGE="JavaScript">
<!--
function orderasc(flag){
var tables = document.getElementById("tableid");
var tbodys=tables.children;
var j=0;
for(var i = 0;i<tbodys.length-1;i++){
for(var k=0;k<tbodys.length-i-1;k++){
var tbody1=tbodys[k]
var tbody2=tbodys[k+1]
var tr1 = tbody1.children[0];
var tr2 = tbody2.children[0];
var td1i = parseInt(tr1.children[3].innerHTML,10);
var td2i = parseInt(tr2.children[3].innerHTML,10);
if(flag==0){
if(td1i > td2i){
tbody.insertBefore(tbody2,tbody1);
}
}else{
if(td1i < td2i){
tbody.insertBefore(tbody2,tbody1);
}
}
}
}
}
//-->
</SCRIPT>
</HEAD>
<BODY>
js排序代码不能实现,请帮我看看什么问题 展开
<TABLE
style="TEXT-ALIGN: center; LINE-HEIGHT: 25px; WIDTH: 990px; FONT-FAMILY: verdana"
cellSpacing=1 cellPadding=3 bgColor=#6593b9 align=center>
<TR style="FONT-WEIGHT: bold" bgColor=#c3dcf0>
<TD width=190>走货渠道</TD>
<TD width=115>体积重量</TD>
<TD width=115>结算重量</TD>
<TD width=115>金额(人民币)<font onclick="JavaScript:orderasc(0)" style="cursor: hand">升</font><font onclick="JavaScript:orderasc(1)" style="cursor: hand">降</font></TD>
<TD width=110>币别</TD>
<TD width=115>递送时间</TD>
<TD width=115>计算公式</TD>
<TD width=115>报价备注</TD></TR></TABLE>
<TABLE
style="TEXT-ALIGN: center; LINE-HEIGHT: 25px; WIDTH: 990px; FONT-FAMILY: verdana"
cellSpacing=1 cellPadding=3 bgColor=#6593b9 align=center id="tableid">
<%
sumprice=20
for i=1 to 5
sumprice=sumprice+1%>
<TBODY >
<TR style="FONT-WEIGHT: bold" bgColor=#c3dcf0>
<TD width=190><% =true_name%></TD>
<TD width=115><%=vweight%>kg</TD>
<TD width=115><% =weight%>kg</TD>
<TD width=115><% =sumprice%>元</TD>
<TD width=110><form action="" method="post" >
<select name="money<%=i%>" >
</select></form></TD>
<TD width=115><%=past_time%></TD>
<TD width=115
><a href="JavaScript:void(0)">计算公式</a></TD>
<TD width=115
><a href="JavaScript:void(0)">报价备注</a></TD>
</TR>
<TR style="FONT-WEIGHT: bold;display:none" bgColor=#c3dcf0 >
<TD width=990 colspan="8">asd</TD>
</TR>
<TR style="FONT-WEIGHT: bold;display:none" bgColor=#c3dcf0>
<TD width=990 colspan="8">sfdaf</TD>
</TR>
</TBODY>
<%next%>
</TABLE>
<p> </p>
<p>
<SCRIPT LANGUAGE="JavaScript">
<!--
function orderasc(flag){
var tables = document.getElementById("tableid");
var tbodys=tables.children;
var j=0;
for(var i = 0;i<tbodys.length-1;i++){
for(var k=0;k<tbodys.length-i-1;k++){
var tbody1=tbodys[k]
var tbody2=tbodys[k+1]
var tr1 = tbody1.children[0];
var tr2 = tbody2.children[0];
var td1i = parseInt(tr1.children[3].innerHTML,10);
var td2i = parseInt(tr2.children[3].innerHTML,10);
if(flag==0){
if(td1i > td2i){
tbody.insertBefore(tbody2,tbody1);
}
}else{
if(td1i < td2i){
tbody.insertBefore(tbody2,tbody1);
}
}
}
}
}
//-->
</SCRIPT>
</HEAD>
<BODY>
js排序代码不能实现,请帮我看看什么问题 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询