如何将服务器端变量转换为客户端的变量?
来源:asp之家 时间:2009-12-03 19:54:00
我们可用下面的代码将服务器端变量转换为客户端的JavaScrit变量:
<%@ Language=VBScript %>
<% Response.Buffer=true%>
<%
set remoteConn = Server.CreateObject("ADODB.Connection")%>
remoteConn.Open "FILEDSN","uid","pwd"%>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<SCRIPT LANGUAGE="Javascript">
var arr = new Array()
var arr1 =new Array()
<% sql="select name,e_mail from emptable" %>
<% set rec11=remoteconn.execute(sql) %>
<% counter1=0 %>
<% while not rec11.eof %>
<% response.write "arr" & "[" & counter1 & "]" & "=" & rec11.fields(0)& ";" %>
<% response.write "arr1" & "[" & counter1 & "]" & "=" & rec11.fields(1)& ";" %>
<% counter1=counter1+1 %>
<% rec11.movenext %>
<% wend %>
<% set rec11= nothing %>
</script>
<body>
</body>
</html>