Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3984
  • 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

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