You can use the JavaScript History object to navigate backward and forward, so long as there is a history to navigate to.
http://www.javascriptkit.com/jsref/history.shtml[
^]
Going forward will only work if the user has visited a page in this current session. If it is a new navigation you will need to initiate with a button click, href, etc.