I am a Java newby, although I have experience with structured programming. I am trying to write a script that displays a series of images (basically, a simple
for loop). Here is the script that I have now:
Code: Select all
<script type='text/javascript'>
var x;
var images = new Array('/I/truckstuffusa_1714_57762239','/I/truckstuffusa_1714_57770303');
var spanHTML = "<image src="+images[[b][i]x[/b][/i]]+">
";
for (x = 0; x < 2; x++)
document.write(spanHTML);
</script>
As of now, the script does not display any images at all (just the red x place holder). However, if I change the
x to 0 or 1 (specifically referencing one of the array elements), the script displays the appropriate image twice. From what I have found on the net, this code is accurate in terms of syntax and all. Can anyone give me some tips as to how to get this running? Thanks!