X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fajax%2FajaxTest.js;h=a84df1d6c9ff261d65c3536fff76ea601545575a;hb=a6ce3031871aca7c067672e91d298dd2a5bf176c;hp=98f7cfcdd918fdf469f24b811c7369fa9a285819;hpb=94e59e287a9fde9425cd96713e8130aef06bc431;p=jquery.git diff --git a/src/ajax/ajaxTest.js b/src/ajax/ajaxTest.js index 98f7cfc..a84df1d 100644 --- a/src/ajax/ajaxTest.js +++ b/src/ajax/ajaxTest.js @@ -277,4 +277,21 @@ test("$.ajax - xml: non-namespace elements inside namespaced elements", function start(); } }); +}); + +test("$.ajax - preprocess", function() { + expect(1); + stop(); + var customHeader = "value-for-custom-header"; + $.ajax({ + url: "data/name.php", + data: {'req': true}, + preprocess: function(xml) { + xml.setRequestHeader('customHeader', customHeader) + }, + success: function(data) { + ok( data == customHeader, "check return value, should be the custom header sent" ); + start(); + } + }); }); \ No newline at end of file