We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

detect Refresh F5

matthew016
matthew016 asked
on
Medium Priority
3,997 Views
Last Modified: 2008-01-09
Is there any way to detect that a page has been refreshed ?

Thank u.
Comment
Watch Question

Awarded 2006
Top Expert 2006

Commented:
<html>
<body onload="alert('Refreshed!')">
</html>

Author

Commented:
I have already :

onLoad="resize()"

how do I add your code ?
Awarded 2006
Top Expert 2006

Commented:
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();">

Author

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
Awarded 2006
Top Expert 2006
Commented:
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

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Awarded 2006
Top Expert 2006

Commented:

Author

Commented:
Thank u very much
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.