title: Set Headers with jQuery.ajax and JSONP?
body: <p>I am trying to access google docs with jQuery.  Here's what I have so far:</p>
  
  <pre><code>var token = "my-auth-token";
  $.ajax({
    url: "http://docs.google.com/feeds/documents/private/full?max-results=1&amp;alt=json",
    dataType: 'jsonp',
    beforeSend: function(xhr) {
      xhr.setRequestHeader("Authorization", "GoogleLogin auth=" + token);
    },
    success: function(data, textStatus, XMLHttpRequest) {
    },
    error: function(XMLHttpRequest, textStatus, errorThrown) {
    }
  });
  </code></pre>
  
  <p>It doesn't allow me to set headers if I set the <code>dataType</code> to <code>jsonp</code> (from <a href="http://www.myviewstate.net/blog/post/2010/02/26/Make-cross-domain-Ajax-requests-with-jQuery.aspx" rel="noreferrer">Make Cross Domain Ajax Requests with jQuery</a>).  If I leave out <code>jsonp</code>, I can't make the cross-domain request.  If I use <code>jQuery.getJSON</code>, I can't pass in any headers...</p>
  
  <p>Is there any way to define custom headers when making a cross-domain ajax request (in jQuery)?</p>