title: I Need a way to execute a particular function when i press the forward key or the back key in javascript
body: <p>I need a way to execute a particular function when I press the forward key or the back key in javascript.  So that it may work when the forward button is pressed it may execute the function but it should work without taking the input in any type of text box.</p>
  
  <p>I mean it should work on the whole page no matter where I am on the page but if I press the forward button the function should be executed.</p>
  
  <p>I know how to do it by taking an input in a text box by matching the key codes but don't know how to make it work in someway else.</p>