mastallama
asked on
Custom History Back and Forward buttons for IE
I have a javascript tool bar that has a back button and a forward button on it. i need these 2 buttons to work exactly the same as the Back and Forward buttons on the IE button toolbar at top (which i hide when i open the window). i know the back button works with window.history.back() but i cannot get the forward button to work and i can't find the javascript for it. Is there some way i can do this by accessing the history array? if so, i'd also like to take out the 1st 2 items in the history for this window (my login scripts) so that the user cannot go back to it.
there is one other thing i must let you know about this toolbar for it to all work properly. The toolbar resides in the top frame of a frames page. i need the forward and back buttons to change the body frame, not the top frame.
thanks,
~ MastaLlama ~
there is one other thing i must let you know about this toolbar for it to all work properly. The toolbar resides in the top frame of a frames page. i need the forward and back buttons to change the body frame, not the top frame.
thanks,
~ MastaLlama ~
ASKER
yes, that works! thanks, but... there is one problem...
how do i target the bottom frame???
how do i target the bottom frame???
Hi mastallama,
how about
<INPUT TYPE="button" VALUE="Click Here" onClick="parent.FrameName. location.h ref='histo ry.forward ()'">
but i'm not sure about that
HAGD:O)Bruintje
how about
<INPUT TYPE="button" VALUE="Click Here" onClick="parent.FrameName.
but i'm not sure about that
HAGD:O)Bruintje
ASKER
yes, that works! thanks, but... there is one problem...
how do i target the bottom frame???
how do i target the bottom frame???
ASKER
oops, sorry, i refreshed the page...hee hee
forget that last comment, lemme try the parent.FramName and i'll get back to ya!
hee hee
forget that last comment, lemme try the parent.FramName and i'll get back to ya!
hee hee
ASKER
that works but brought up another problem...if there is no forward page, the forward button is still there and active and gives me a blank page. can i test the # of pages in the history and hide the forward button when you can't go no forward, or hid the back button when you can't go back anymore (just like IE) ?
~ MastaLlama ~
~ MastaLlama ~
Hi mastallama,
completely missed your last comment, this code let you check the length of the history and the number of pages hence and forth
http://www.suite101.com/article.cfm/javascript/48508
HAGD:O)Bruintje
completely missed your last comment, this code let you check the length of the history and the number of pages hence and forth
http://www.suite101.com/article.cfm/javascript/48508
HAGD:O)Bruintje
Do you have a particular place you want to go from each page? Otherwise, there ISN'T any 'forward' -- you can't call something that hasn't happened yet.
If you know what you want to be the next page, hard code that in. You can actually javascript it so that the link is different based on where they are.
If you know what you want to be the next page, hard code that in. You can actually javascript it so that the link is different based on where they are.
ASKER
no, the forward needs to work just like the IE forward...if someone clicks back, then they can come back to the last page by hitting forward, so in fact it has happened already, i just need to access it again.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
yea, i've read it and i'm testing it right now
ASKER
Thanks Bruintje! It works perfectly now!
great to hear that
from
http://www.sbrady.com/hotsource/javascript/back.html
<form>
<input type="button" value="Back" onclick="history.back()">
<input type="button" value="Forward" onclick="history.forward()
</form>
HAGD:O)Bruintje