Custom headers with $.ajax type jsnop or json
问题 I have a problem with sending some custom headers to with a jQuery ajax JSON (or JSONP) request. Code looks like this: $.ajax({ beforeSend: function(xhr) { xhr.setRequestHeader("X-VER", VER); xhr.setRequestHeader("X-TIMESTAMP", now); }, type: 'GET', data: null, url: site_uri, dataType: 'jsonp', success: function(msg){$(selector).html(msg);} }); Firebug shows no custom headers. In addition the url changes with jsonp (can I change this?) Edit: I found that it probably violates http://en