title: jQuery ajaxSetup beforeSend not executing in IE8
body: <p>My project uses jQuery 1.4.2.
  I've got some security information that I add to my AJAX headers... 
  The way I'm doing this is by using $.ajaxSetup(), and setting a beforeSend function. </p>
  
  <pre><code>$(document).ready(function (e) {
      $.ajaxSetup({
          global: true,
          beforeSend: function (jqXHR, settings) {
              var verificationToken = 'some encrypted string';
              jqXHR.setRequestHeader("X-Request-Verification-Token", verificationToken);
          }
      });
  })
  </code></pre>
  
  <p>As I understand it, this should then execute every time I make a call to $.ajax(), right?
  It works fine in Chrome, Firefox, IE9, and so on, but occasionally <em>not</em> in IE7/8.</p>
  
  <p>Here's where I call it:</p>
  
  <pre><code>$.ajax({
      type: "POST",
      async: true,
      data: 'somedata',
      url: "/some/url",
      success: function (data) {
          alert("success");
      },
      error: function (data) {
          alert("error");
      }
  });
  </code></pre>
  
  <p>I've found a workaround, which is to add the beforeSend directly to the $.ajax() call (below), but I really want to do this globally, rather than have to add it to loads of places in the code...</p>
  
  <pre><code>$.ajax({
      type: "POST",
      async: true,
      data: 'somedata',
      url: "/some/url",
      success: function (data) {
          alert("success");
      },
      error: function (data) {
          alert("error");
      }
      beforeSend: function (jqXHR, settings) {
          var verificationToken = 'some encrypted string';
          jqXHR.setRequestHeader("X-Request-Verification-Token", verificationToken);
      }
  });
  </code></pre>
  
  <p>Any clues?</p>
  
  <p>Thanks!
  Neil</p>