title: Basic authentication for a url in an iframe
body: <p>I need to authenticate a request being sent from an iframe (which is being created through javascript) on a page.  The authentication will be done with basic http authentication.  I've tried doing</p>
  
  <pre><code>http://user:password@server
  </code></pre>
  
  <p>but apparently this is unavailable in IE because of a security exception:</p>
  
  <p><a href="http://support.microsoft.com/kb/834489" rel="noreferrer">http://support.microsoft.com/kb/834489</a></p>
  
  <p>Is there another way I can add the authentication into the request so the iframe will automatically authenticate with the server?  Thanks.</p>
  
  <p>Here's the code I'm currently using that doesn't work:</p>
  
  <pre><code>var url = 'http://userName:test@localhost:12000/Service.svc/GetStatus';
  
  try {
      // Attach image to cache auth
      var frame = $('&lt;iframe /&gt;');
  
      frame.load(function() {
          alert('here');
      });
  
      $('body').append(frame);
  
      frame.attr('src', url);
      //img.remove();
  }
  catch (e) {
  
  }
  </code></pre>