FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

Frames and Their History Objects

 


NewGuyinTown
Code:

<iframe name="looklook" src="blahblah.html"></iframe>
<input type="button" onClick="looklook.history.back()" value="Back">


I have a problem with the History Objects. It seems to me that the History Objects of the topmost window/frame (top.history) and its frames (looklook.history) are the same. I thought that the frame is a new Window Object and has its own unique History Object. When I checked the length of both History objects, they are same - which is odd because I just visited the page; the length of the frame's history should be 0. When I hit the "Back" button, it takes me back to the referrer (eg. Google). I want to make the "Back" button to go one page back in the frame (eg. looklook). If there are no previous page before the current one, then it does nothing.

Tested on both IE and Mozilla Firefox. Is it just a browser issue? Confirmation (Yep, this is so/No... blah blah) or any explanations that this is indeed true are appreciated.

Thank you.
NewGuy
Aredon
If the frame is pointed at google.com then looklook.history.back() should generate an error since the frame is pointed at a different server/domain/subdomain. If however the pages were from your server blahblah.html, blahblah1.html, blahblah2.html, you should have no issues with the back button since each frame keeps its own history.
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.