title: How do you make an event listener that detects if a boolean variable becomes true?
body: <p>For example, I have <code>var menu_ready = false;</code>. I have an ajax function that sets <code>menu_ready</code> to true when the ajax stuff is done:</p>
  
  <pre><code>//set up event listener here
  
  $(...).load(..., function() {
      ...
      menu_ready = true;
  }
  </code></pre>
  
  <p>How do I set up an event listener that waits for <code>menu_ready</code> to be true?</p>