Solved

detect Refresh F5

Posted on 2006-11-04
7
3,963 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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
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…

757 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now