webdork
asked on
Javascript loop
I'm trying to preload a variable number of images. I can do most of what I want in asp but I'm not good with js. I'd like to use only js in the load command but will consider using both vbscript and js. The snippet below is what i want but it's not rendering.
****************CODE****** ********
'Determine the number of images
picnumof = ((Recordset1.Fields.Item(" Pictures - Number of").Value) -1)
'DEBUG TO BE REMOVED
'response.write picnumof
<%
for i=1 to picnumof
imageload = imageload + "'http://vxxxxxxxxx.maximumasp.com/ress/img/40047429_0" & i &".jpg', "
next
%>
<body onLoad="MM_preloadImages(' <%=imagelo ad%>')">
****************CODE******
'Determine the number of images
picnumof = ((Recordset1.Fields.Item("
'DEBUG TO BE REMOVED
'response.write picnumof
<%
for i=1 to picnumof
imageload = imageload + "'http://vxxxxxxxxx.maximumasp.com/ress/img/40047429_0" & i &".jpg', "
next
%>
<body onLoad="MM_preloadImages('
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Thanks all for your contribution. I'm out of town for Tgiving and away from the PC ball and chain. Back to work on Mon and will test latest suggestions and respond then. (No time for good grammer).
<%
'Determine the number of images
picnumof = ((Recordset1.Fields.Item("
'DEBUG TO BE REMOVED
'response.write picnumof
%>
<script language="JavaScript"><!--
for(var i=0; i < <%=picnumof%>; i++) {
imageLoad = imageLoad + '/ress/img/40047429_0' + i + '.jpg';
}
//--></script>
<body onload="MM_preloadImages(i