Testcase for jQuery Ticket 6778
Enhancement request to set type for dataFilter automagically is dataType option isn't explicitly set for ajax request
by jitter
JavaScript
function dataFilterer( data, type ) {
if ( type === undefined ) {
alert( "Boohoo type not automagically set by httpData" );
} else {
alert( "type is: " + type );
return data;
}
}
$(function() {
$.ajax({
url: "/echo/html/",
data: {
html: "<p>foo</p>"
},
dataFilter: dataFilterer
});
$.ajax({
url: "/echo/html/",
data: {
html: "<p>foo</p>"
},
dataType: "html",
dataFilter: dataFilterer
});
});