Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I pass an array from the server to my page?

Status
Not open for further replies.

bigfoot

Programmer
May 4, 1999
1,779
US
Note: without doing it in the url, as it will be about 30 pairs.

--Gary The door to life is never locked, but few have the knowledge to open it.
 
Yes, I am getting 3 pairs of data out of a database. The door to life is never locked, but few have the knowledge to open it.
 
then just print it to the page...

var x = new Array();
<%
while(!rs.EOF)
{
%>
x[x.length] = <%=rs(&quot;fieldname&quot;).VaLUE%>
<%
}
%> adam@aauser.com
 
How do I get the data in the first place out of the database? I can't read it off the server can I? The door to life is never locked, but few have the knowledge to open it.
 
oh.. i thought you had that part handled....


well, for that you'll have to use some sort of SS language, asp, perl, or something... adam@aauser.com
 
I do, but can I make an asp array and pass it to a JS array???

How do I marry the two? The door to life is never locked, but few have the knowledge to open it.
 
you'll have to print it put on the page...

x = new Array();
<%
for(var i = 0; i < array.length; i++)
{
%>
x[x.length] = &quot;<%=array%>&quot;;
<%
}
%>

sorry if you're not using JScript... i'm not too familiar with vbscript... so my example uses jscript... adam@aauser.com
 
Can I use JavaScript as my client language? This way I can read the db and keep the array in memory, er. no. himmmm
Somebody has had to have done this before!!!

This is driving me nuts X-) The door to life is never locked, but few have the knowledge to open it.
 
yes.. you can use any client side language you want... you just need to use asp to get the data to the client-side language.... adam@aauser.com
 
WOW!!!! Now I get it!!:)
I can write the page in ASP just like I was creating HTML code! I write the javascript code with asp's Response.Write, and the page will execute it!

WOW, this is neat.

Thanks a bunch :p

-Gary The door to life is never locked, but few have the knowledge to open it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top