Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Where is my previous page???

Status
Not open for further replies.

lcfc

Programmer
Dec 4, 2001
27
GB
Hi i use a piece of script that allows my page to break out of other peoples frames:

Code:
<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 for an example:
Can anybody tell me how to get around this?
 
why not just use top.location = self.location;????

When you use &quot;replace&quot; your are replacing the history with the new page...


if (self != top){
top.location = self.location;
}



Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook
 
Thanks for the reply. When i click back now it just seems to refresh the current page. To see what i mean try the example again.
 
If you remove this code, does the back button work alright?

Is this code located on your frampage?

What are you trying to do?

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook
 
When somebody links to the webpage from a framed site (like the example) it creates an error, therefore i was trying to 'bust' the frames when my site loads. I think the origional error occured because i am using a script that rebuilds the frames around orphan pages.

click the example above, then click the link, it takes you to my website. The code is located in the frameset.

 
The example works fine and removes the frame. Are you worried about them being able to click &quot;back&quot; and get where they came from?

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook
 
>Are you worried about them being able to click &quot;back&quot; and >get where they came from?

Yes that is exactly it!!
 
Well the address in the address bar says


but the link I clicked on initially says:


Are you adding some data and calling the page again somehow? If I look quickly, it looks like a form is autosubmitting or something - right?


Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook
 
When you click on this link it takes you to (the frameset).


The mainFrame in the frameset is home.htm. To stop search engines only finding home.htm and loosing the frames i am using a script that rebuilds the index.htm frameset around home.htm or any orphan page, for that matter.

This seems to work ok, unless you link from another page using frames, as in the example, so i put in the piece of script to 'bust' the frames. Now as you see it works, but the user cannot go back to the place they came from.

Easy eh!!!!
 
I think that that code is overwriting the history object (poosibly using location.replace again). If that's the case, then people who access your site using a link in a frame (not too common???) will not be able to go back...

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top