Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-16-2002, 03:15 PM   PM User | #1
kalleballe
New to the CF scene

 
Join Date: Jun 2002
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
kalleballe is an unknown quantity at this point
Page reload

Hello!

I'm looking for a script that can reload a page immidietly when the surfer enters it, but only ONCE.
kalleballe is offline   Reply With Quote
Old 06-16-2002, 03:26 PM   PM User | #2
JohnKrutsch
Regular Coder

 
Join Date: Jun 2002
Location: The Planet Earth Code Poet: True
Posts: 282
Thanks: 0
Thanked 1 Time in 1 Post
JohnKrutsch is an unknown quantity at this point
You could try something like this but it kind of depends on how you are already using the querystring:

if(document.location.search.substr(1)!="reloaded")location=location.href+"?reloaded"
JohnKrutsch is offline   Reply With Quote
Old 06-16-2002, 03:48 PM   PM User | #3
kalleballe
New to the CF scene

 
Join Date: Jun 2002
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
kalleballe is an unknown quantity at this point
thank you! it's working perfect!

is it possible to get rid of the ?reloaded extension at the url? it's not important, just want to know if it's possible
kalleballe is offline   Reply With Quote
Old 06-16-2002, 11:57 PM   PM User | #4
JohnKrutsch
Regular Coder

 
Join Date: Jun 2002
Location: The Planet Earth Code Poet: True
Posts: 282
Thanks: 0
Thanked 1 Time in 1 Post
JohnKrutsch is an unknown quantity at this point
Not using this method, thats how it knows it has been reloaded once.
JohnKrutsch is offline   Reply With Quote
Old 06-17-2002, 01:02 AM   PM User | #5
glenngv
Supreme Master coder!


 
glenngv's Avatar
 
Join Date: Jun 2002
Location: Los Angeles, CA Original Location: Philippines
Posts: 10,241
Thanks: 0
Thanked 112 Times in 111 Posts
glenngv will become famous soon enough
there is another way of doing this.

<head>
<script>

if (window.name!="reloaded") doRefresh();

function doRefresh(){
window.name="reloaded";
location.reload();
}
</script>
</head>

if the current window or frame is not a target of any link or form, then you can do the trick with window.name. This property persists even if the page has unloaded.

Quote:
Originally posted by kalleballe
thank you! it's working perfect!

is it possible to get rid of the ?reloaded extension at the url? it's not important, just want to know if it's possible
__________________
Glenn
_____________________________________________
Play Tower of Hanoi Android app (Ad-FREE!)
Play Tower of Hanoi Android app (FREE!)
Go to Tower of Hanoi Leaderboard
Play Tower of Hanoi Facebook app
glenngv is offline   Reply With Quote
Old 06-17-2002, 01:20 AM   PM User | #6
JohnKrutsch
Regular Coder

 
Join Date: Jun 2002
Location: The Planet Earth Code Poet: True
Posts: 282
Thanks: 0
Thanked 1 Time in 1 Post
JohnKrutsch is an unknown quantity at this point
Nice one!

Quote:
Originally posted by glenngv
there is another way of doing this.

<head>
<script>

if (window.name!="reloaded") doRefresh();

function doRefresh(){
window.name="reloaded";
location.reload();
}
</script>
</head>

if the current window or frame is not a target of any link or form, then you can do the trick with window.name. This property persists even if the page has unloaded.

JohnKrutsch is offline   Reply With Quote
Old 06-17-2002, 07:41 PM   PM User | #7
FJbrian
Regular Coder

 
Join Date: Jun 2002
Location: Adirondacks
Posts: 516
Thanks: 4
Thanked 4 Times in 4 Posts
FJbrian is on a distinguished road
why not just use a meta tag to refresh the page?
I have a similar question in the cgi board so....maybe this is my answer
Oh no wait that would referesh the page multiple times....

oh well

John you work for theplanet.com?
FJbrian is offline   Reply With Quote
Old 07-21-2002, 04:37 PM   PM User | #8
meems
New Coder

 
Join Date: Jun 2002
Location: Arl
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
meems is an unknown quantity at this point
I am wondering how to use this reload once script when a back button is pressed? Certain select boxes disappear and have to do a refresh but only once.
Thanks
meems is offline   Reply With Quote
Old 07-21-2002, 05:12 PM   PM User | #9
FJbrian
Regular Coder

 
Join Date: Jun 2002
Location: Adirondacks
Posts: 516
Thanks: 4
Thanked 4 Times in 4 Posts
FJbrian is on a distinguished road
not sure ya can
of course you could axe the browser toolbars and add in your own back button to do this
FJbrian is offline   Reply With Quote
Old 09-12-2002, 07:23 PM   PM User | #10
fitchic77
New Coder

 
Join Date: Sep 2002
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
fitchic77 is an unknown quantity at this point
if(document.location.search.substr(1)!="reloaded")location=location.href+"?reloaded"

I used this above. The problem is that I have to use the browsers BACK button to get back to the original page...this doesn't work for that...

any ideas??

Thanks!!
Andrea
fitchic77 is offline   Reply With Quote
Old 09-13-2002, 04:09 AM   PM User | #11
FJbrian
Regular Coder

 
Join Date: Jun 2002
Location: Adirondacks
Posts: 516
Thanks: 4
Thanked 4 Times in 4 Posts
FJbrian is on a distinguished road
boy is this easy and yet I'm drawing a blank
go offline and type in a webpage URL
hold your mouse over the text part that says "Back"
it's history-1 or something like that

sorry, overtired.
use that code

hope this blather helps
FJbrian is offline   Reply With Quote
Old 09-13-2002, 12:17 PM   PM User | #12
fitchic77
New Coder

 
Join Date: Sep 2002
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
fitchic77 is an unknown quantity at this point
my boss won't let me use a back button...it has to be the browsers button...

I'm stumped:

See it in action at:

http://209.118.243.140/test/golfpac3/index.cfm?reloaded


Thanks,
Andrea
fitchic77 is offline   Reply With Quote
Old 09-13-2002, 02:56 PM   PM User | #13
fitchic77
New Coder

 
Join Date: Sep 2002
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
fitchic77 is an unknown quantity at this point
Got it

location.replace(targetURL);

This doesn't record any history in the browser...so I have a redirect page from the posted page which does this piece of code...works great.

see it if you'd like:
http://209.118.243.140/test/golfpac3/index.cfm


THANKS AGAIN
fitchic77 is offline   Reply With Quote
Old 09-14-2002, 01:30 AM   PM User | #14
FJbrian
Regular Coder

 
Join Date: Jun 2002
Location: Adirondacks
Posts: 516
Thanks: 4
Thanked 4 Times in 4 Posts
FJbrian is on a distinguished road
hey fitchick,
if you ever start an affiliate program, lemme know
I'd imagine I could "peddle your wares" thru my site
FJbrian is offline   Reply With Quote
Old 09-14-2002, 02:01 AM   PM User | #15
fitchic77
New Coder

 
Join Date: Sep 2002
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
fitchic77 is an unknown quantity at this point
Give me your email address. Our live address is:

http://www.golfpactravel.com


I'm not sure what you are hinting too, so drop me an email:

andreafowler@aol.com


Thanks,
Andrea
fitchic77 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:02 PM.


Advertisement
Log in to turn off these ads.