javascript 下拉框关联时的数组问题
在用javascript做客户端的,下拉框关联时,关联数据库的表超过三千条(行),就出现错误提示。
个人怀疑是数组长度的上限所至,请各位高手指教!
代码如下:
<script language = "JavaScript">
<%
'打开专业表,第二层
dim rs,sql,count,rs1,sql1
sql = "select * from district order by locationid asc"
set rs = conn.execute(sql)
%>
//第二层,数组表
var onecount;
onecount=0;
subcat = new Array();
<%
count = 0
do while not rs.eof
%>
subcat[<%=count%>] = new Array("<%= trim(rs("districtname"))%>","<%= trim(rs("locationid"))%>","<%= trim(rs("districtid"))%>");
<%
count = count + 1
rs.movenext
loop
rs.close
set rs=nothing
%>
onecount=<%=count%>;
//获得第二层选项
function changelocation(locationid)
{
document.myform.smalllocation.length = 0;
var locationid=locationid;
var i;
document.myform.smalllocation.options[0] = new Option('====所有地区====','0');
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
document.myform.smalllocation.options[document.myform.sm
相关问答:
如何实现当鼠标悬停控件上时,出现该控件的尾部显示对应的层,鼠标移动到该层上进行相应的操作,当鼠标移除时(不在控件上也不在层上)层隐藏,
http://topic.csdn.net/u/20090830/23/5e5ded07-7216-46c2-9712- ......
三个数x,y,z 比大小..
var x,y,z,t;
if (x>y)
{t=x;x=y;y=t;} //交换x,y的值
if(x>z)
{t=z;z=x;x=t;}//交换x,z的值
if(y>z)
{t=y;y=z;z=t;}//交换z,y的值
这是 ......
我也来一个趣味javascript:
打开以下html文件,依次按下G,L,C三个键,就会有奇迹出现!!
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" ......
问题内容:判断顺序号列及子序号列必须为数字。
<td><div align="center"><input type="text" name="xuHao${g+1}" class="inputW" value="& ......
设有众多div层 希望点击到那个层,就获得那个层的id
问题是 我想把id转换成一个可以alert的数字
因为我需要这个数字来确定数组中的某一项
例如
我定义某个div的id为e1
点击他后 与之对应的数组aaa[1]中的数据返 ......