PaulBricker
Programmer
What I currently have is a page (sorry it's an intranet site so I can't display it)that has a scroller I got at Dynamic Drive. I have to go in manually and change the content of that scroller each week. I would like to be able to pull the content for the scroller from a database table instead so that the Admin Assistant can make the changes in the table and keep me out of the loop. So to that end, I have this on my page.
The result should produce script that looks like this
that get passed to this function
The first code does produce a string result that gives me the appearance I need in the array, but, of course, Response.Write just writes it to the page. I need to create a <script type = "text/javascript"></script> array on the page that the function can read.
Clear as mud?
Anyone have any ideas?
I thought I had found a winner here
but I can't get it to work.
Thanks
Paul
Code:
[green]<%ON ERROR RESUME NEXT
IF rst.EOF THEN
Response.Write "There are no entries in the database."
ELSE
Response.Write "var pausecontent2=new Array();"%>[/green]
<p>
[green]<% i = 0
DO WHILE NOT rst.EOF
Response.Write "pausecontent2[" & i & "]='" & rst("Dept ID") & "';"[/green]
<p>
[green]<%
i=i+1
rst.MoveNext
Loop
END IF %>[/green]
The result should produce script that looks like this
Code:
<script type="text/javascript">
var pausecontent2=new Array()
pausecontent2[0]='Dining Hall Windows'
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'
</script>
that get passed to this function
Code:
<script type="text/javascript">
new pausescroller(pausecontent2, "pscroller2", "someclass", 3000)
</script>
Clear as mud?
Anyone have any ideas?
I thought I had found a winner here
but I can't get it to work.
Thanks
Paul