title: How do I clear a WebView's content before loading a page?
body: <p>I have an embedded WebView in my Cocoa application in which I load an external web page. Each time the user clicks on a button, the view opens and shows the page.</p>
  
  <p>The problem is that the second time the user opens the WebView, the previous page is still visible. Instead I'd like to show a blank/empty page (together with a progress indicator).</p>
  
  <p>How can I clear a WebView before loading a new page? </p>
  
  <p>The closest solution I could find was to call this:</p>
  
  <pre><code>[webView stringByEvaluatingJavaScriptFromString:@"document.open();document.close()"];
  </code></pre>
  
  <p>Is there a better way to do this?</p>
  
  <p>Thanks!</p>