Xylude,
I'm amazed that
bakeryImage.src=image; works in any browser! I can only think it's picking up on the name attribute rather than the id. Names are more liberally interpreted.
Try this - three goes in one line for good cross-browser compatibility plus the safety of setting null if they all fail:
function swapImage(image){
var bakImg = (document.getElementById) ? document.getElementById('bakeryImage') : (document.images) ? document.images['bakeryImage'] : (document.all) ? document.all['bakeryImage'] : null;
if(bakImg) bakImg.src = image;
}
Should work in all major browsers.
Airshow
Reputation Points: 300
Solved Threads: 357
WiFi Lounge Lizard
Offline 2,522 posts
since Apr 2009