title: jQuery .load(function) synchronous
body: <p>What is the best way to use the jQuery load function synchronously.</p>
  
  <p>I need to load an image but can't execute the next line of code until that image has loaded.</p>
  
  <p>I could loop a variable until the load has completed but was wondering if there was a better way of doing that.</p>
  
  <pre><code>var img = jQuery('&lt;img src="' + url + '"/&gt;').load(function () {                 
  
              });  
    //Run code here once img load has comlpeted.                                              
  </code></pre>