Re: Simple image swap not working...Why?
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Re: Simple image swap not working...Why?

From: VK <schools_ring@yahoo.com>
Date: Fri Apr 28 2006 - 19:41:45 CEST

Ed Jay wrote:
> Why doesn't the following swap images?
>
> <head>
> <javascript type="text/javascript">
> function swapImage() {document.images.image1.src=/images/1stimage.gif;}
> function swapBack() {document.images.image1.src=/images/2ndimage.gif;}
> </script>
> </head><body>

because you did not enclose the URI string in quotes:

document.images.image1.src="/images/1stimage.gif";
Received on Mon May 1 05:25:51 2006