Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trouble changing SRCs

Status
Not open for further replies.

TheOrange

Programmer
Jun 23, 1999
14
US
I've encountered what seems like a bug. I use Netscape Navigator 4.6. I write code so that when a button image is clicked it changes the src of a different image, say from image1.jpg to image2.jpg. What will happen is the first time I try it out, it doesn't change the SRC, and the original image (image1.jpg) remains. If however, latter in the function I ask it to alert to me alert(document.image1.src); at the end of the function, it will change the image1 src to image2.jpg right after it alerts me. Also, henceforth, if I remove the alert everything works fine. As soon as I restart Netscape though, the problem starts all over. Doesn anybody know what is happening, I can give urls if necessary.
 
did you use the good old:<br>
onClick="image1.src='image1.gif'"<br>
JavaScriptlet in the control image & the good old<br>
name=image1<br>
in the "slave" image???<br>
<br>
<br>
-Robherc<br>
robherc@netzero.net
 
Alrighty it appears as if I have a stop gap solution. If, when the page is loading I do an onLoad="document.image1.src='blank.jpg'"; Which is what I wanted it to be, just blank to begin with, even though the src is already blank.jpg. Later on I can manipulate the src. Thanks for the help though. If you wanted to see what it was its at I was trying to make it so that the little "Back" image at the top of the screen would appear when you reached the end of the 3 problem list. Keep in mind though, that this is just the skeleton of the site.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top