我在Chrome中遇到问题。我收到了这个错误:
未捕获的TypeError:无法调用未定义的方法'ajaxSetup'
这是我的代码:
function getRating(objId, holder) {
if (!objId || !holder) {
return;
}
$.ajaxSetup({cache: false}); // The error occurs here
$.get('assets/components/lexrating/connector.php',{
action: 'web/count/get',
id: objId
}, function(data) {
var response = JSON.parse(data);
if (response.object) {
$(holder).rateit('value', response.object.value);
var readonly = (response.object.allowedToVote === true) ? false : true;
$(holder).rateit('readonly', readonly);
var counterHolder = '#count_' + $(holder).prop('id');
$(counterHolder).text(response.object['total.voters']);
}
});
}