Detect browser's back & forward (NEWBIE)

K

knoak

Hi there,

I have a forum that is launched inside a frameset.
The frameset is built with 2 frames: A top frame
of 80 px height, and a content frame with a relative
size of 1.

Anyway, i have no toolbars, statusbars and locationbar etc.
So i want 2 buttons (back & forward) in the top frame to
replace the browser's function.
How do i know if there is a previous or next page?
If there is one, i want to display a button to navigate.

What i tried is:
if(history.back()==""){blabla.innerhtml=""}
else {blabla.innerhtml="<<"}

Hope you get the idea..

Greetings Knoak
 
K

kaeli

Anyway, i have no toolbars, statusbars and locationbar etc.
So i want 2 buttons (back & forward) in the top frame to
replace the browser's function.

You don't want your forum to be very popular among people over 25, do
you? (the older a person is, the less likely they are to be comfortable
with 'the web thingy')
Don't do stuff like this. It makes things very difficult for the vast
majority of internet users who are used to the way their browsers work
and get very confused if you mess it up.
The rest of us will just right click and use back and forward.

We finally get the people trained and you want to go and confuse them!
*LOL*

As to using the history object, you really can't do much with it.
Because it has all the URLs the person visited in whatever time they
have it set to keep track of, it has privacy and security issues. It
isn't good for much else than a back button, and even then you don't
know where it's going.
The best you're going to get is having a forward button with
history.forward and a back button with history.back, but those are
easily broken when there is nothing to go forward or back TO.
You could always play with URL variables or cookies or something, but
it's really a lot of work to replace something the browser already has.

--
--
~kaeli~
Contrary to popular opinion, the plural of 'anecdote' is
not 'fact'.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
 
K

knoak

Well, i know this is kind of confusing
to mess with the browser, and it's purpose is
not to disable any functions, but to save some room
on the screen.

The forum is popped up in a new window which is resizable
and has scrollbars, nothing more, nothing less.
Since it's popped, there can not be any other page in the
back or forward of history than a page of the forum itself.

I know there is something like history.length(). Can i
(ab)use this in any way?

Any help would be greatly appreciated...

greetings
 
R

Richard Cornford

knoak said:
Well, i know this is kind of confusing
to mess with the browser, and it's purpose is
not to disable any functions, but to save some room
on the screen.

That is not a good excuse as the browsers already have that covered by
allowing the user to select the chrome that they feel suites their
situation. IE, for example, allows button to be big or small icons, with
or without labels (or not present at all), or F11. If screen size is an
issue for a user then they can already do something about it. The
probability is that suitably fluid page design would make any
consideration of the user's available display area irrelevant.
The forum is popped up in a new window which is resizable
and has scrollbars, nothing more, nothing less.

*May* be pooped up in a new window, which *may* have only scrollbars and
be re-sizeable. Users already have the option of denying you that level
of control (and it doesn't mean anything in some tabbed/MDI browsers
anyway).
Since it's popped, there can not be any other page in the
back or forward of history than a page of the forum itself.

If the user has set up their browser to re-direct - window.open - calls
to the current window then it may still have a history.
I know there is something like history.length().

It is a property not a method.
Can i (ab)use this in any way?

Yes, it will tell you if the history has length. But you cannot tell
where you are within the history so knowing how long it is will not help
much.
Any help would be greatly appreciated...

Leave it to the browser to handle back and forward button, any attempt
to reproduce that functionality with client-side scripting is
reinventing a wheel, with a predictably square outcome.

Richard.
 
K

knoak

The website i'm doing this for, is for a group of people
of wich i know that they're very probable to use the
browser's default settings.

And even if they're not, hey i'm still the designer/builder,
so it's up to me to decide wether or not to hide the chrome..
Maybe just an answer on a technical question would be better
tha start the ethical crap...
(No offence though)

Greetings knoak
 
K

kaeli

The website i'm doing this for, is for a group of people
of wich i know that they're very probable to use the
browser's default settings.

If it's an intranet application, you can make an HTA instead. MSIE/Windows
only. You get a lot more control with an HTA.
Otherwise, you're outta luck. ;)
Too many people would abuse the history object if it were accessible in a
general internet environment, so it isn't. MSIE may have a hack, but if it
did, it wouldn't work in other browsers.
And even if they're not, hey i'm still the designer/builder,
so it's up to me to decide wether or not to hide the chrome..

I'm the user. It's MY browser.
People who think like you do are the reason we had to make browsers that deny
you the ability to **** up our interfaces.
No offense intended. :p

--
 
T

Thomas 'PointedEars' Lahn

knoak said:
The website i'm doing this for, is for a group of people
of wich i know that they're very probable to use the
browser's default settings.

Which browser are you talking about? Is it guaranteed
that only this browser will be used? If so, how?
And even if they're not, hey i'm still the designer/builder,
so it's up to me to decide wether or not to hide the chrome..

No, it is not, because the chrome is simply not your concern!
The *content* (document) is. You can make *suggestions* about
the chrome with some features of host object's methods, that's
all, and that's a Good Thing. If you want to control the chrome,
write a HyperText Application (IE only), a Gecko-compatible
extension (to make use of its chrome) or a fat client.
Maybe just an answer on a technical question would be better
tha start the ethical crap...

Maybe you should start thinking what you would think of someone who
would try to interfere with what you are used to. Maybe you should
start thinking about the diversity of the Web and its users. Maybe
you should just start thinking.
(No offence though)

It is easy to say "no offence" when you have already pissed off people
by displaying a not-learning attitude and by using ... colorful language.


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top