如何aaa.asp页面获取bbb.asp页面的数组数据库数据呢
aaa.asp页面文件代码:<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<html>
<head>
<script language="javascript" type="text/javascript">
function aaa()
{
var a = document.getElementById("shi1");
var b = 【这里如何获取bbb.asp页面的数组数据库数据呢】
【
var n=b.length;
for (var i=0;i<n;i++)
{
var c = document.createElement("option");
c.text = b[i]["tf"];
c.value = b[i]["vf"];
】【大括号里我写的可能也不对,随意修改,只要不跑题就好。】
if (a.options.add)
{
a.options.add(c);
}
else
{
a.appendChild(c);
}
}
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title></title>
</head>
<body>
<form name="form1" method="post" action="">
<table align="center">
<tr>
<td><select name="shi1" id="shi1">
</select></td>
<td><input name="chuang" type="button" id="chuang" onClick="aaa()" value="显示并创建" /></td>
</tr>
</table>
</form>
</body>
</html>
bbb.asp页面文件代码:
<!--#include file="conn.asp" -->
<%
dim ccc,ddd
ccc="select * from rencaizhaopin where shi is not NULL"
set ddd=server.createobject("adodb.recordset")
ddd.open ccc,aaa,1,1
%>
<%
dim eee
eee = "<script language=""javascript"" type=""text/javascript"">var b = new Array([1,1],[2,2]);"
if ddd.eof and ddd.bof then
do while not ddd.eof
eee=eee&"["&ddd("shi")&"],"
ddd.MoveNext
loop
else
do while not ddd.eof
eee=eee&"["&ddd("shi")&"],"
ddd.MoveNext
loop
end if
eee=eee&");</script>"
response.write(eee)
%>
我的QQ:448571358请前辈也留下QQ,我真心结交。
【上边的代码我怎么试也不成,难住我了,希望路过的前辈能把我的代码给修改下,望路过的前辈指点,留步教我。】
[ 本帖最后由 qq448571358 于 2012-6-29 02:36 编辑 ]