<%for i=0 to rs.recordcount
if rs.eof then exit for
%>
array[<%=i%>] ="<%=rs("city")%>"
<%
rs.movenext
next
%>

解决方案 »

  1.   

    <%for i=0 to rs.recordcount
    if rs.eof then exit for
    %>
    array[<%=i%>] ="<%=rs("city")%>";
    <%
    rs.movenext
    next
    %>
      

  2.   

    <%
    while not rs.eof
    %>
    array.push("<%=rs("city")%>");
    <%
    rs.movenext
    wend
    %>
      

  3.   

    <%
    do while not rs.eof
    %>
    array[array.length]=("<%=rs("city")%>");
    <%
    rs.movenext
    loop
    %>
      

  4.   

    那如果数组是这样的要怎么办
    array_name['111','222','333','444','555']
    array_address['111','222','333','444','555']
      

  5.   

    那如果数组是这样的要怎么办
    array_name['111','222','333','444','555']
    array_address['111','222','333','444','555']-->
    array[<%=rs.recordcount%>]=[<%for i=0 to rs.recordcount:if rs.eof then exit for:%>'<%=rs("city")%>',<%rs.movenext:next%>]
      

  6.   

    在js中好象不能有<%%>这个吧 
    <script language="javascript">
    <%for i=0 to rs.recordcount
    if rs.eof then exit for
    %>
    array[<%=i%>] ="<%=rs("city")%>";
    <%
    rs.movenext
    next
    %>
    </script>
      

  7.   

    那读下来的数组如何引入<script></script>内呢?
    比如我要重新格式化数组再输出就是把页面里的数组信息在另一个页的<script>array['5555','4444','3333','222','11']</script>标记内输出
      

  8.   

    js文件中可以写<%%>这样的,不过文件扩展名要是asp的
      

  9.   

    <%%> ??
    我要放入<script></script>内的