Click to See Complete Forum and Search --> : Where has my previous page gone?


spacedhopper
08-13-2003, 05:20 AM
Hi i use a piece of script that allows my page to break out of other peoples frames:


<SCRIPT>
<!--
if (self != top){
if (document.images) top.location.replace(self.location);
else top.location = self.location;}
// -->
</SCRIPT>

This works great, but if i click back, doesn't keep the previous page in history, or just completely bypasses it. See here (http://ibs.derby.ac.uk/avru/test/test.htm) for an example.

Can anybody tell me how to get around this?

Charles
08-13-2003, 05:44 AM
Try this one instead:

<script type="text/javascript">
<!--
if (top.location != self.location) top.location.replace(self.location)
// -->
</script>

Gollum
08-13-2003, 05:45 AM
My guess is you don't want to use top.location.replace() as the replace() function replaces the current location in the history.

Charles
08-13-2003, 05:48 AM
Originally posted by Gollum
My guess is you don't want to use top.location.replace() as the replace() function replaces the current location in the history. I'm quite sure that you do want to use replace, otherwise when you step back you will be thrown forwards again. You have to remove from the history the page that does the redirecting.

spacedhopper
08-13-2003, 05:49 AM
Hi thanks for the reply. It still doesn't work though. It allows me to go back now, but seems to go back one page too far.

See above example again.

Any ideas?

Charles
08-13-2003, 05:57 AM
I'm not sure what's going on, your page is now crashing my browser. That might be your HTML. It's a strange combination of HTML and XHTML and it doesn't conform to any DTD with which I'm familiar.

spacedhopper
08-13-2003, 06:02 AM
I'm not sure what's going on, your page is now crashing my browser. That might be your HTML. It's a strange combination of HTML and XHTML and it doesn't conform to any DTD with which I'm familiar.

Oh dear that is probably my inexperience showing!! Thanks for trying anyway - back to the drawing board!!