PaulBricker
Programmer
I currently have a loop that pulls values from a table and writes them to a page.
But what I would like to do is store the values returned by the loop in variables. I want to use those variables in a Javascript routine that I use. This is part of the Javascript routine.
Currently, I have the values for the array hard coded. What I would like is to replace those hard coded values with a variable something like this
pausecontent2[0]=<%=ASPvariable0%>
where ASPvariable0 is the first value returned by my loop.
I would like the variables to be dynamic if possible (the number of records returned can change week to week), but would be content with any solution.
Thanks very much.
Paul
Code:
<%WHILE NOT rst.EOF
FOR i = 0 to rst.recordcount-1
Response.Write rst(i)
NEXT
rst.MoveNext
WEND%>
But what I would like to do is store the values returned by the loop in variables. I want to use those variables in a Javascript routine that I use. This is part of the Javascript routine.
Code:
<script type="text/javascript">
/*Example message arrays for the two demo scrollers*/
var pausecontent2=new Array()
pausecontent2[0]='Dining Hall Window Replacement'
pausecontent2[1]='WB Bathroom conversion'
pausecontent2[2]='Chapel/Parking Lot Light'
pausecontent2[3]='Ath Ctr Rooftop Unit Repair'
pausecontent2[4]='Ath Ctr Wrestling Room Roof'
pausecontent2[5]=''
</script>
Currently, I have the values for the array hard coded. What I would like is to replace those hard coded values with a variable something like this
pausecontent2[0]=<%=ASPvariable0%>
where ASPvariable0 is the first value returned by my loop.
I would like the variables to be dynamic if possible (the number of records returned can change week to week), but would be content with any solution.
Thanks very much.
Paul