pauli
08-05-2003, 04:05 AM
Can anyone tell me why the 'menu' object becomes 'undefined' on the first recursive call ???
function displayNextImage(imagePlace,menu) {
var new_image = getNextImage();
menu.selectedIndex = ImageIndex;
document[imagePlace].src = new_image;
timerID = setTimeout('displayNextImage("'+imagePlace+'",menu)', interval);
}
menu is a 'select' object name passed from the HTML code initially. The idea is to display the next image and update a select list to show which image is being displayed.
As I said it works fine when first called, but dies at first recursive call.
Thanks
function displayNextImage(imagePlace,menu) {
var new_image = getNextImage();
menu.selectedIndex = ImageIndex;
document[imagePlace].src = new_image;
timerID = setTimeout('displayNextImage("'+imagePlace+'",menu)', interval);
}
menu is a 'select' object name passed from the HTML code initially. The idea is to display the next image and update a select list to show which image is being displayed.
As I said it works fine when first called, but dies at first recursive call.
Thanks