asp 列表的问题 高手进来!

来源:百度知道 编辑:UC知道 时间:2024/06/13 22:11:40
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="css/style.css" rel="stylesheet" type="text/css">
</head>
<%dim count
set rs=server.createobject("adodb.recordset")
rs.open "select * from w163_sort2 order by Nclassidorder ",conn,1,1%>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<%
count = 0
do while not rs.eof
%>
subcat[<%=count%>] = new Array("<%= trim(rs("Nclass"))%>","<%= rs("anclassid")%>","<%= rs("Nclassid")%>");
<%
count = count + 1
rs.movenext
loop
rs.close
%>

onecount=<%=count%>;

function changelocation(locationid

<script language = "JavaScript">
……
……
</script>
是运行在客户端的。它的性质决定它不能这样和<% %>中的数据公用。

如果你想这样运行的话。建议你用
response.write("<script language = ""JavaScript"" & vbcrlf>
")
……
……
response.write("<script language = ""JavaScript"">
" & vbcrlf)