title: Check if site uses Basic Auth via AJAX
body: <p>Is there a way to check via AJAX, if a website uses Basic Authorization, without letting the browser display the login dialog box?</p>
  
  <p>My current call is:</p>
  
  <pre><code>$.ajax
      type: 'HEAD'
      url: url
      success: (data) -&gt;
           console.log 'jep'
      error: (jqXHR, textStatus, errorThrown) -&gt;
           console.log 'nope'
  </code></pre>
  
  <p>This will always display the login dialog box if the site uses authorization. However, I just want to know if the site is protected with a basic authorization or not. I couldn't find a way to do so. I'm aware of <a href="https://stackoverflow.com/questions/1616277/ajax-authentication-without-letting-browser-pop-up-login-dialog">this</a> solution, but I can't edit the server response.</p>