At least for the JUnit plugin they are referencing an older version of Jenkins.
if(window.jQuery === window.$) { //Is jQuery the active framework?
$.ajax({
type: "POST",
url: url+methodName,
data: stringify(a),
contentType: 'application/x-stapler-method-invocation;charset=UTF-8',
headers: {'Crumb':crumb},
dataType: "json",
success: function(data, textStatus, jqXHR) {
if (callback!=null) {
var t = {};
t.responseObject = function() {
return data;
};
callback(t);
}
}
});
} else { //Assume prototype should work
new Ajax.Request(url+methodName, {
method: 'post',
requestHeaders: {'Content-type':'application/x-stapler-method-invocation;charset=UTF-8','Crumb':crumb},
postBody: stringify(a),
onSuccess: function(t) {
if (callback!=null) {
t.responseObject = function() {
return eval('('+this.responseText+')');
};
callback(t);
}
}
});
}