Click to See Complete Forum and Search --> : History Object Properties
Frank
04-30-2003, 02:45 AM
Hi
I am quite new at web development and this question might seem silly.
I am currently working with frames and I have a home link that navigates you back to the start up page by loading the appropriate pages within the different frames.
This works fine until someone decides to use the windows back button which simultaneously moves back a page for each frame at a time.
I know that you don't have much control over the history object's properties but is there a way for me to determine when the back button on the windows/History object is clicked and thereby controlling where it takes you to?
I am using ASP
Will JavaScript help me in this endeavor?
Is it also just possible to disable the back and forward buttons when a new page loads in a frame?
Thanks
Frank
Nicodemas
05-01-2003, 12:10 PM
It is possible to load a page without back/forward buttons in javascript, but not specifically with ASP. Ask those guys on the javascript boards :) They may explain modeless windows and such to you.
As for your original question, though, there is no way to control what page a user goes to through the back button, unless you have a special script that could possible detect if the they visit is already in their history and can then decide where to redirect them to... but that sounds like an awful headache to me.
cmelnick
05-02-2003, 11:01 AM
First of all, you do not have control over the browser forward and back buttons, although you can get rid of the whole navagation bar, but then you have to put forward and back buttons on all your pages.
OK, you didn't really ask for my advice, just my solutions, but I will give you my advice anyway...
I have done quite a bit of web development, and I stay away from frames whenever possible. I would highly recommend that you do the same. They end up being a huge headache, and there are plenty of ways to do the same thing as frames, but in single pages. So far, in all my development, I have really only used frames when I navigate away from my page to another page, and I might use frames to give the user an easy way to get back to my page. But I never ever use frames to navigate around my own site.
So you might say "then I will have to add the same code for my navigation bar on each page, and if I change a link on one page, I will have to update this everywhere!" Welcome to the world of server-side includes, if your server supports them. That allows you to include files. So you could have one html file that was called "navigate.html" which would contain all your links. Then in every page that uses those links, you would just add the line <!-- #include file="navigate.html" -->. Like magic, it includes the contents of navigate.html into your current page.
Just do a google search for "Server-side include" for detailed info.
I am sure someone won't like this, but it is my personal preference.
Frank
05-05-2003, 11:02 AM
Thanks guys for your inputs the turned out to be very helpful.
I went through some documentation before I started my project and I did gather that frames are not the best option but this system I have been developing is a simple intranet system for my company and the frame issue is easier to control in this instance, however I am definitely staying away from them.
Again thanks for providing me with the information which eventually led to the solution.
Frank
:D