title: Can you wait for javascript callback?
body: <p>I'm trying to use the jQuery alerts dialog library from <a href="http://abeautifulsite.net/notebook/87" rel="noreferrer">http://abeautifulsite.net/notebook/87</a> instead of the default alerts (which look pretty awful in my opinion). This seems to be a great library, but there is not an example of how to use the jConfirm library.</p>
  
  <p>I need to do something like this:</p>
  
  <pre><code>function confirm() {
          var result = false;
          var response = false;
          jConfirm('are you sure?', 'Confirmation Dialog',
            function(r) {
              result = r;
              response = true;
              return r;
          });
          if (response == true) {
              alert(result);
              return result;
          }
          else {
              //wait for response
              alert('hi');
          }
      }
  </code></pre>
  
  <p>and my call from my .net button:
  </p>
  
  <p>I've posted a comment on the plugin's website (just this morning) and did Google searches for javascript and waiting for a callback to complete with no results.</p>
  
  <p>Any ideas on how to use the callback correctly to get the result, before the rest of the javascript executes?</p>
  
  <p>Thanks.</p>