Evertjan. wrote:
DoomedLung wrote on 02 feb 2006 in comp.lang.javascript:
Hey... what I want to know is can you stop a page from reload?
Please quote what you are replying to. This is usenet not email.
If you want to post a followup via groups.google.com, don't use the
"Reply" link at the bottom of the article. Click on "show options" at the
top of the article, then click on the "Reply" at the bottom of the article
headers. <http://www.safalra.com/special/googlegroupsreply/>
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Hey, sorry for the inconvenience..I'm new to usenet.
Ok at the moment I'm in the middle of writting a script that rewrites a
html page from an event handler that supplies the image url and title
for the page. Once the user fires the event in Firefox the
functionality works fine until the user presses the Reload button then
the dynamic image disappears!
Now I gather as much that it's not displaying the image because the
image doesn't actually exsist... so I'm kinda stuck on dealing with the
reload issue in FireFox. here is the code:
function largeImg(imgSrc, title){
var w = window;
var d = w.document;
d.write('<html><head><title>'+title+'</title>');
d.write('<sc'+'ript>');
d.write('function doTitle(){document.title="'+title+'";}');
d.write('function centerIt(){');
d.write('theDiv = document.getElementById("theImage");');
d.write('centerHeight = document.body.clientHeight / 2 -
document.getElementById("imgName").height / 2;');
d.write('theDiv.style.top = centerHeight;}');
d.write('</sc'+'ript></head>');
d.write('<body onload="doTitle(); centerIt();" onResize="centerIt();"
bgcolor="#ffffff" topmargin="0" leftmargin="0" marginheight="0"
marginwidth="0">');
d.write('<center>');
d.write('<div id="theImage" style="position:relative;
text-align:center">');
d.write('<img id="imgName" name="imgName" src="'+imgSrc+'"
alt="'+title+'" title="'+title+'" border="0">');
d.write('<br><br>');
d.write('<div style="text-align:center; font-family:Verdana, Arial,
Helvetica, sans-serif; font-size:10px; color:#000000";>');
d.write('<a href="javascript
:history.back()" title="Go back to
'+title+'">Go back</a> | <a href="#" title="Take the Playboy UK Free
Tour">Take the Playboy UK Free Tour</a><div></div></center>');
d.write('</body></html>');
d.close();
}
<a href="enable.html" onClick="largeImg('imgs/tgpA/large/large1.jpg',
'Document Ten'); return false;">
<img src="imgs/tgpA/thumbs/thumb1.jpg" alt="..." title="..."
width="90" height="120" border="0"></a>
Any guidance would be much appreciated