[Javascript] Netscape Refreshing page after load

Rees, Mark (TWIi London) mrees at twii.net
Wed Jul 18 06:25:00 CDT 2001


--------

"I alter the images src and border using javascript further down on the page
by accessing them with 
document.layers[i].document.images[j].src = nsimageFalse.src "
-------
Try putting this in a function to be called in the onLoad event of the body.
Cheers

Mark



-----Original Message-----
From: Nils Tärnqvist [mailto:Nils.Taernqvist at LUVIT.se]
Sent: 18 July 2001 11:58
To: javascript at LaTech.edu
Subject: [Javascript] Netscape Refreshing page after load


Hello everone, 
here is my problem: 
I have a page with multiple divs with pictures in them, i set all attributes
for them in HTML first öike this: 
<div id="blockDiv0>" style="position: absolute; left: <%=xstart(i)%>; top:
<%=ystart(i)%>; width: <%=xplus(i)%>; height: <%=yplus(i)%>;"> 
<a href="javascript:reverseVisibility('blockDiv0','im0')"> 
<img name="im0" id="im0" src="transp400x500.gif" width=<%=xplus(i)-9%>
height=<%=yplus(i)-65%>> 
</a> 
</div> 


I alter the images src and border using javascript further down on the page
by accessing them with 
document.layers[i].document.images[j].src = nsimageFalse.src 
Where nsimageFalse is initialized like this 
nsimageFalse = new Image(); 
nsimageFalse.src = "chess.gif"; 


The change works well and i see that the image have changed on screen, when
all changes are donw and page is loaded 
completely, all the changes done with javascript goes away and Im left with
the original image i set with html. 
It looks like the page is refreshed/redrawn for some reason. 
Any1 know what I could be doing wrong or what i could have left out? 


Really appreciate all help i can get! 
Nisse 



More information about the Javascript mailing list