i am having problems with a simple imageswapping function - it works right in ie but not in firefox. here is part of my code and the firefox error which is displayed. i figure that i should be checking for firefox browser as well, but i have other stuff that does work and didn't have to do a browser check. thanks in advance
browserName = navigator.appName;
browserVer = parseInt(navigator.appVersion);
if (browserName == "Netscape" && browserVer >= 3) browserVer = "1";
else if (browserName == "Microsoft Internet Explorer" && browserVer == 4) browserVer = "1";
else browserVer = "2";
//image loading function used on photo pages
function load_pics(num_pics, fold_name){
for (i=1; i <=num_pics; i++)
{
photo[i] = new Image(); LINE 50
photo[i].src = fold_name + "pic" + i + ".jpg";
}
}
//image swapping function:
function image_swap(image_id, image_name) {
if (browserVer == 1) {
document.images[image_id].src = eval(image_name + ".src"); LINE 57
return true;
}}
Error: photo is not defined
Source File: XXXX(i changed this)
Line: 50
Error: photo is not defined
Source File: XXXXLine: 57
Last edited by hodgezz; 05-11-2006 at 03:16 PM..
|