faqts : Computers : Programming : Languages : JavaScript

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

12 of 27 people (44%) answered Yes
Recently 4 of 10 people (40%) answered Yes


Is there a Javascript equivalent of the 'Forward' button in Microsoft Outlook

Apr 7th, 2008 23:32
ha mo, Colin Fraser, Nick Hearn,

No, but there is nothing to stop you from making one yourself. A button
is an image and if you have the right graphics tools, like Photoshop,
you can make your own buttons. As aln alternate there are a number of
sites around that supply matching sets of buttons if you want to use
them. All browsers since Netscape v3 and IE v4 support the images
object, and you can link these images to the history object, 
To get it to work you can use code like : 
  <a href="javascript:null()" onClick="history.back()"><img
src="backbtn.gif"  border=0></a>
  <a href="javascript:null()" onClick="history.forward()"><img
src="fwdbtn.gif"  border=0></a>
or you may want to use something like 
  <a href="javascript:null()" onClick="history.go(-1)"><img
src="backbtn.gif"  border=0></a>
  <a href="javascript:null()" onClick="history.go(1)"><img
src="fwdbtn.gif"  border=0></a>
The only issue is how can you determine whether or not there is a page
to go forward to in the history. You may want to link a button that can
be inactive when there is no forward page to go to. Otherwise the buton
is continually active. If there is no page to go to, there is no error,
no 404 error, just nothing happens.