title: jQuery - re-execute a function on button click
body: <p>I have a pretty unique situation where I need a bunch of jQuery code to re-execute on a button click. The added complications are:</p>
  
  <ul>
  <li>I can't allow the browser window to refresh</li>
  <li>All the code is within a setTimeout() parameter - not sure if this really matters</li>
  </ul>
  
  <p>I can't wrap the code inside a click event as it needs to run automatically on first opening or refresh of the page. To add a bit of context I've mocked up the following:</p>
  
  <pre><code> setTimeout(function() {
       // all the scripts that need to run
   }, 2500);
  
   $('.btn').click(function() {
       // re-run the above code without refreshing window or browser
   });
  </code></pre>
  
  <p>Is there a way to re-run the code on a button click in this context?</p>