Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Refresh

Reply
Thread Tools

Refresh

 
 
DoomedLung
Guest
Posts: n/a
 
      02-02-2006
Hey everyone,

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

 
Reply With Quote
 
 
 
 
loyal_caper@easypeas.net
Guest
Posts: n/a
 
      02-02-2006
¿qué?
 
Reply With Quote
 
 
 
 
DoomedLung
Guest
Posts: n/a
 
      02-02-2006
ok smart ass! I need to work with the refresh functionality of
browsers. Can it be done?

 
Reply With Quote
 
Evertjan.
Guest
Posts: n/a
 
      02-02-2006
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)
 
Reply With Quote
 
DoomedLung
Guest
Posts: n/a
 
      02-02-2006
Hey... what I want to know is can you stop a page from reload?

 
Reply With Quote
 
Evertjan.
Guest
Posts: n/a
 
      02-02-2006
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)
 
Reply With Quote
 
DoomedLung
Guest
Posts: n/a
 
      02-02-2006

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

 
Reply With Quote
 
Evertjan.
Guest
Posts: n/a
 
      02-02-2006
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)
 
Reply With Quote
 
DoomedLung
Guest
Posts: n/a
 
      02-02-2006

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 ]

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Remote Desktop Window Does Not Refresh When Roaming =?Utf-8?B?R2F6VUs=?= Wireless Networking 2 07-11-2005 07:44 AM
JSP: Session parameters vanish on refresh. How do I keep them on refresh? Per Magnus L?vold Java 1 10-08-2004 02:52 PM
How do i refresh a datagrid from a pop up window without having to refresh the whole page? Pkenty ASP .Net Web Controls 0 05-28-2004 07:06 AM
using refresh button on the menu bar to refresh two frames. Jawahar Rajan ASP General 1 10-01-2003 09:20 PM
Problem with refresh button breaking automatic refresh brian lanning ASP .Net 0 07-29-2003 07:57 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57