全局发送头添
$(document).ajaxSend(function(event, jqxhr, settings) {
jqxhr.setRequestHeader("Auth","http://xxx.com");
});
只处理指定页面
$(document).ajaxSend(function(event, jqxhr, settings) {
if ( settings.url == "ajax/test.html" ) {
$( ".log" ).text( "Triggered ajaxSend handler." );
}
});