title: window.location doesn't work after an AJAX request in Internet Explorer
body: <p>I am trying to launch a ClickOnce application via a link on a web page.  The link has to go to the server to request a transaction GUID before it can launch the application.  The code works like this:</p>
  
  <pre><code>function clickHandler() {
      $.post('/gettransactionid.aspx', function(tranId) {
          console.log("BEFORE");
          window.location = "/deploy/Company.Domain.Product.application?" + tranId;
          console.log("AFTER");
      });
      return false;
  }
  </code></pre>
  
  <p>This works perfectly fine in Firefox but in IE it peforms a navigation and doesn't open the clickonce application.  The console.log BEFORE and AFTER are shown in the console window in IE8 dev tools.  Any help would be appreciated as I've spent 4 hours on this trying to solve it with various hacks!</p>
  
  <p>I have tried:</p>
  
  <ul>
  <li>changing the window.location to a window.open.  This just fires up a window for a second and fails to launch the application.</li>
  <li>an alert instead of window.location.  This does nothing.</li>
  <li>Against IE7, IE8 and IE9.</li>
  <li>Circumventing browser security by adding it to a queue and processing the window.location in the root window context.</li>
  <li>I have checked gettransactionid.aspx returns the transaction id.</li>
  <li>Doing it in Firefox - it works fine.</li>
  </ul>
  
  <hr>
  
  <p>Found the Answer in Microsoft's documentation:</p>
  
  <blockquote>
    <p>If you have developed a custom Web page that launches a ClickOnce application using Active Scripting, you may find that the application will not launch on some machines. Internet Explorer contains a setting called Automatic prompting for file downloads, which affects this behavior. This setting is available on the Security Tab in its Options menu that affects this behavior. It is called Automatic prompting for file downloads, and it is listed underneath the Downloads category. The property is set to Enable by default for intranet Web pages, and to Disable by default for Internet Web pages. When this setting is set to Disable, any attempt to activate a ClickOnce application programmatically (for example, by assigning its URL to the document.location property) will be blocked. Under this circumstance, users can launch applications only through a user-initiated download, for example, by clicking a hyperlink set to the application's URL.</p>
  </blockquote>
  
  <p>Update 1st September 2011: Ironically this has now broken entirely in IE9 thanks to "Automatic prompting for downloads" being removed.</p>