You can't do it with Javascript. However...
Client side coding like javascript can't connect to a serverside database. You need serverside code/scripting.
I don't like ASP, so here's an example in php... use asp if you so desire.
Just an example, so won't fit exactly what you are doing, but it's a good start.
PHP Code:
//MORE JAVASCRIPT ABOVE...//
var dynimages=new Array()
<?php //connect to database here
$query = mysql_query("SELECT `URL` FROM `images`");
while ($row = mysql_row_assoc($query)) {
echo 'dynimages['.$n.']=["'.$row['URL'].'", \"\"]';
$n++;
}
?>
That will print a link of terms with increasing $n values for dynimages[0], dynimages[1], etc. with the URL from the database (table "images") as the url of the image.
Make sense?
Bookmarks