Solved

detect Refresh F5

Posted on 2006-11-04
7
3,971 Views
Last Modified: 2008-01-09
Is there any way to detect that a page has been refreshed ?

Thank u.
0
Comment
Question by:matthew016
  • 4
  • 3
7 Comments
 
LVL 30

Expert Comment

by:callrs
ID: 17872982
<html>
<body onload="alert('Refreshed!')">
</html>
0
 
LVL 9

Author Comment

by:matthew016
ID: 17873004
I have already :

onLoad="resize()"

how do I add your code ?
0
 
LVL 30

Expert Comment

by:callrs
ID: 17873038
Add as many commands as needed, separated with a semicolon:
<body onload="alert('Refreshed!'); resize();">

Or, add to the resize function:
<script type="text/javascript">
function resize(){
// other statements
alert("Refreshed!");
}
</script>
<body onload ="resize();">
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 9

Author Comment

by:matthew016
ID: 17873058
Thanks, but I can notice that the first time it laods the page I can also see the alert,
Actually I wanted to detect only REfresh
0
 
LVL 30

Accepted Solution

by:
callrs earned 500 total points
ID: 17873312
You may have to use cookies (http://www.quirksmode.org/js/cookies.html)

I haven't yet come up with a working solution, but did do some research:
http://www.experts-exchange.com/Web/Q_20614880.htm detecting browser refresh
http://www.tedpavlic.com/post_detect_refresh_with_javascript.php  Detecting Page Refreshes
http://www.google.ca/search?hl=en&q=browser+refresh+site%3Aexperts-exchange.com
0
 
LVL 30

Expert Comment

by:callrs
ID: 17873313
0
 
LVL 9

Author Comment

by:matthew016
ID: 17873338
Thank u very much
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question