valeria_vi
11-14-2002, 03:18 PM
here's a piece of my function:
if (document.layers) {
document.layers["point-of-purchase-display-kits"].document.kit.src = "popkits/0" + new_kit + ".gif";
}
else {
if (document.getElementById) {
alert("1")
document.getElementById('kit').src = "popkits/0" + new_kit + ".gif";
}
else {
alert("2")
document.kit.src = "popkits/0" + new_kit + ".gif";
}
}
new_kit is a variable containing a number.
i have a layer on a page and that layer has an image with a name "kit" in it.
works great in NS on PC and MAC, as well as IE on a PC.
IE 5.0 on a MAC alerts "1" (which means it understands "if (document.getElementById)"), but then does not change an image and gives me an error saying "document.getElementById(...) is not an object".
document.kit.src = "popkits/0" + new_kit + ".gif"; works (again, ie on a mac), but how can it recognise document.getElementById and then give me such an error? is my conditional statement wrong?
if (document.layers) {
document.layers["point-of-purchase-display-kits"].document.kit.src = "popkits/0" + new_kit + ".gif";
}
else {
if (document.getElementById) {
alert("1")
document.getElementById('kit').src = "popkits/0" + new_kit + ".gif";
}
else {
alert("2")
document.kit.src = "popkits/0" + new_kit + ".gif";
}
}
new_kit is a variable containing a number.
i have a layer on a page and that layer has an image with a name "kit" in it.
works great in NS on PC and MAC, as well as IE on a PC.
IE 5.0 on a MAC alerts "1" (which means it understands "if (document.getElementById)"), but then does not change an image and gives me an error saying "document.getElementById(...) is not an object".
document.kit.src = "popkits/0" + new_kit + ".gif"; works (again, ie on a mac), but how can it recognise document.getElementById and then give me such an error? is my conditional statement wrong?