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" ......
怎么才能判断键盘是否被按下和松开。。。。。不知道怎么判断。。。谁能告诉我下吗。。。。谢谢
onkeydown和onkeyup事件
引用
onkeydown和onkeyup事件
自动触发这两个事件
onkeydown 按下
onkeyup 松开
......
jsp页面1中:
我定义了一个变量flag
<script language="javascript"> var flag=1;</script>
jsp页面2中:
在此页面中想获取flag这个变量
<% String flag=request.getParameter(" ......