title: JQuery "undo" an action by calling another function when back clicked
body: <p>Is there a way to "undo" a function executed by jQuery when the back button is clicked? For example, my function that I want to execute is named doSomething:</p>
  
  <pre><code>function doSomething(button) {
       ...clicking the button does something...
  }
  </code></pre>
  
  <p>And I have an undo function that undoes the above function, undoDoSomething:</p>
  
  <pre><code>function undoDoSomething(button) {
      ....undoes the doSomething function...
  }
  </code></pre>
  
  <p>How do I call the function for the button and then if the back button is clicked right after I execute the function, I can call the undoDoSomething function to undo that function?</p>
  
  <p>I know jQuery History goes back to a previous page saved in history but how do I use that to call a function? </p>