• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3989
  • Last Modified:

detect Refresh F5

Is there any way to detect that a page has been refreshed ?

Thank u.
0
matthew016
Asked:
matthew016
  • 4
  • 3
1 Solution
 
callrsCommented:
<html>
<body onload="alert('Refreshed!')">
</html>
0
 
matthew016Author Commented:
I have already :

onLoad="resize()"

how do I add your code ?
0
 
callrsCommented:
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
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

 
matthew016Author Commented:
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
 
callrsCommented:
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
 
callrsCommented:
0
 
matthew016Author Commented:
Thank u very much
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now