469,600 Members | 2,393 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,600 developers. It's quick & easy.

swap image in netscape

hi, i am using the following to change an image from one to another.
below is a stripped down version of the code i am using:

function swaptheimage () {

document.GetElementById('theimage').src = 'images/newimage.gif';

}

this works fine in Internet Explorer, but in Netscape what would i
replace 'document.GetElementById('theimage').src' with??? cheers

burnsy
Jul 23 '05 #1
2 959
Impresive it works in Internet Explorer :o)

Remember : Java script is case sensitive!

document.getElementById('theimage').src = 'images/newimage.gif';

Kind Regards

Nick

"mr_burns" <bi******@yahoo.co.uk> wrote in message
news:65**************************@posting.google.c om...
hi, i am using the following to change an image from one to another.
below is a stripped down version of the code i am using:

function swaptheimage () {

document.GetElementById('theimage').src = 'images/newimage.gif';

}

this works fine in Internet Explorer, but in Netscape what would i
replace 'document.GetElementById('theimage').src' with??? cheers

burnsy

Jul 23 '05 #2
On 21 Apr 2004 05:01:52 -0700, mr_burns <bi******@yahoo.co.uk> wrote:
hi, i am using the following to change an image from one to another.
below is a stripped down version of the code i am using:

function swaptheimage () {
document.GetElementById('theimage').src = 'images/newimage.gif';
}

this works fine in Internet Explorer, but in Netscape what would i
replace 'document.GetElementById('theimage').src' with??? cheers


A simpler and more reliable solution is

document.images[ 'theimage' ].src = URL;

Mike
Please don't use tabs to indent code when posting to newsgroups. Change
them to spaces: between two and four.

--
Michael Winter
M.******@blueyonder.co.invalid (replace ".invalid" with ".uk" to reply)
Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Randell D. | last post: by
3 posts views Thread by Dietmar Prantner | last post: by
2 posts views Thread by Frank Bishop | last post: by
2 posts views Thread by Matthew | last post: by
2 posts views Thread by broms10 | last post: by
14 posts views Thread by Otto Meijer | last post: by
12 posts views Thread by LAshooter | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.