title: Javascript block script execution
body: <p>I need to do something like this:</p>
  
  <ul>
  <li>Execute a piece of code</li>
  <li>Start to load an image and block the script execution</li>
  <li>When the image is loaded resume the execution</li>
  <li>Execute the rest of the code</li>
  </ul>
  
  <p>I know that the simplest way is to assign a function on the onload event of the image and then execute the rest of the code in the function, but if it's possible i want to have a "linear" behaviour blocking the script execution and then resume it.
  So, is there a cross-browser way to do this?</p>