Closed Thread Icon

Preserved Topic: Refresh that doesn't break the 'back' button? (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=17959" title="Pages that link to Preserved Topic: Refresh that doesn&amp;#039;t break the &amp;#039;back&amp;#039; button? (Page 1 of 1)" rel="nofollow" >Preserved Topic: Refresh that doesn&#039;t break the &#039;back&#039; button? <span class="small">(Page 1 of 1)</span>\

 
Das
Maniac (V) Inmate

From: Houston(ish) Texas
Insane since: Jul 2000

posted posted 05-11-2001 00:14

I'm trying to eliminate my 'enter' page. The problem is, my main page is in PHP, and my start page (as defined by my webhost) must be 'index.html'. Someone in the Asylum once posted how to do a auto-refresh that doesn't break the back button.

The only books I have suggest using window.location.href=URL combined with <META HTTP-EQUIV="REFRESH">. The problem with these is that once you've been forwarded, you can't use your back button easily (you hit back, which takes you to the auto-forwarding page, which takes you right to the page you were on when you hit back...).

I've been flipping through my JavaScript books, but I can't find the command that doesn't break the back button.

Das
Maniac (V) Inmate

From: Houston(ish) Texas
Insane since: Jul 2000

posted posted 05-11-2001 00:32

Never mind. While the host's faq says that the homepage must be named 'index.html', I tried putting up a page named 'index.php3', and it worked.

mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 05-11-2001 07:01

window.location.replace(URL);

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 05-11-2001 19:27

Yeah, the replace function changes it without entering the current page in the history.

Note that the "window." isn't necessary in that. I'm not sure a lot of people realize that. "window.location" is equivalent to just plain ol' "location", and also to "self.location" and "window.self.window.window.self.self.self.self.window.location". (window and self both refer to the top level object, the Window object, which contains the references to itself called window and self. it's a circular thing. it's not necessary to use it as often as it's used.)

« BackwardsOnwards »

Show Forum Drop Down Menu