-
December 14th, 2007, 07:04 AM
#1
Reload page in javascript
hi
when the browser refresh the page alert("msg") will be show using javascript .
-
December 14th, 2007, 08:00 AM
#2
Re: Reload page in javascript
Page reload is not directly detectable. Your only option would be to create a cookie with the URL as the value and check for that cookie with the onload event. Then, if the cookie value is equal to the current URL, then the page has either been reloaded, or entered twice.
You should easily be able to figure the code out.
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
December 17th, 2007, 08:32 AM
#3
Re: Reload page in javascript
use
<body onload="alert(msg);">
-
December 17th, 2007, 09:13 AM
#4
Re: Reload page in javascript
Originally Posted by Snowcore
use...<body onload="alert(msg);">
The original poster only wants it when the page is reloaded, not loaded every time.
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
December 24th, 2007, 01:08 PM
#5
Re: Reload page in javascript
Using PeejAvery's approach, setting the cookie in the onunload event with an expiration of, say 5 seconds would allow detecting the cookie onload. If the cookie is found, throw the alert message.
I recognize the thread is a tad old, but if the original poster wants this type of solution, I suppose he'll be asking how to code it as well. That's where you come in Paul.
*9-11-01* Never Forget; Never Forgive; Never Relent!
"If we ever forget that we're one nation under God, then we will be a nation gone under." - Ronald Reagan
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|