title: javascript: waiting until property of an element is ready to continue
body: <p>I have a property of an element that is injected into my page from a 3rd party:</p>
  
  <pre><code>document.querySelector('#embed-container #mf2-events').jsMF2
  </code></pre>
  
  <p>the jsMF2 is said injected property. I need to wait until the jsMF2 property is defined in order to do work with it. Originally, I just set a timeout, but this is undesirable for many reasons. Is there a way I can spin until the property or set a callback? If this was a C program, I would write something like this:</p>
  
  <pre><code>    while (document.querySelector('#embed-container #mf2-events').jsMF2 === undefined ||
             document.querySelector('#embed-container #mf2-events').jsMF2 === null) { } 
  
      // do work
  </code></pre>