By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,963 Members | 1,276 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,963 IT Pros & Developers. It's quick & easy.

Refresh

P: n/a
Hey everyone,

I was just wondering is the refresh process in browsers able to be
scripted upon.

Feb 2 '06 #1
Share this Question
Share on Google+
8 Replies


P: n/a
¿qué?
Feb 2 '06 #2

P: n/a
ok smart ass! I need to work with the refresh functionality of
browsers. Can it be done?

Feb 2 '06 #3

P: n/a
DoomedLung wrote on 02 feb 2006 in comp.lang.javascript:
ok smart ass! I need to work with the refresh functionality of
browsers. Can it be done?


Please explain what you are talking about.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Feb 2 '06 #4

P: n/a
Hey... what I want to know is can you stop a page from reload?

Feb 2 '06 #5

P: n/a
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)
Feb 2 '06 #6

P: n/a

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

Feb 2 '06 #7

P: n/a
DoomedLung wrote on 02 feb 2006 in comp.lang.javascript:

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>');


Why would you want to write a new clientside dynamic page?
And why not the onclick in the <img> itself?
And why not use css all over?

Much better, in my view, is to make use of the DOM,
redesign the page
and fill an existing img with a new picture, like:

======================
<img id='pic' style='display:none;'>

<div id='tit'></div>

<img src="imgs/tgpA/thumbs/thumb1.jpg" onClick=
"largeImg('imgs/tgpA/large/large1.jpg','Document Ten')"
style ='width:90px;height:120px'
id='thumb'>
...<script...
function largeImg(imgSrc, title){
var pic = document.getElementById('pic')
var thumb = document.getElementById('thumb')
var tit = document.getElementById('tit')
pic.src = imgSrc
window.title = tit.innerHTML = title
document.body.style.backgroundColor = 'navy'
document.body.style.color = 'yellow'
pic.style.display = 'block'
thumb.style.display = 'none' // if you wish
}
======================

not tested

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Feb 2 '06 #8

P: n/a

Evertjan. wrote:
DoomedLung wrote on 02 feb 2006 in comp.lang.javascript:

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>');


Why would you want to write a new clientside dynamic page?
And why not the onclick in the <img> itself?
And why not use css all over?

Much better, in my view, is to make use of the DOM,
redesign the page
and fill an existing img with a new picture, like:

======================
<img id='pic' style='display:none;'>

<div id='tit'></div>

<img src="imgs/tgpA/thumbs/thumb1.jpg" onClick=
"largeImg('imgs/tgpA/large/large1.jpg','Document Ten')"
style ='width:90px;height:120px'
id='thumb'>
..<script...
function largeImg(imgSrc, title){
var pic = document.getElementById('pic')
var thumb = document.getElementById('thumb')
var tit = document.getElementById('tit')
pic.src = imgSrc
window.title = tit.innerHTML = title
document.body.style.backgroundColor = 'navy'
document.body.style.color = 'yellow'
pic.style.display = 'block'
thumb.style.display = 'none' // if you wish
}
======================

not tested

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)


Hey dude, thanks for the advice and your speedy response...

Now that you mentioned the DOM I don't why I didn't think of it in the
first place...

Cheers :o]

Feb 2 '06 #9

This discussion thread is closed

Replies have been disabled for this discussion.