Sevi

I am using javascript to change the source of an image. if I address the image by document.image_name.src='new address'. IE7 reports an error saying. document.image_name is nul of not an object.

If I address the omage by using image_name.src='new address' IE7 changes the address. I have had this problem in IE6 as well all elements would not accept having document added in front of them. I had to leave the document section off. But this is a problem as the page needs to work in all browse and other browse insist on having the document section appended to the front.

I have tired using the document.getElementById() method but this never fetches the element. Is this a problem that other people find, since I have seen from other source codes that the use of document does it work in IE6 and 7.



Re: Internet Explorer Web Development javascript

Mathieu Perceau


I use :
document.getElementById("id_picture").src ="http://new_src"

and I have no problem with any browser on windows or mac.

--
Mathieu Perceau




Re: Internet Explorer Web Development javascript

Sevi

Thanks for that, that has made it work correctly.