执行此代码时出现此错误:
第TypeError: Illegal invocation
var req = $.ajax
var data_ = {
id: id_,
name: name_,
raiting: user_votes
};
$('#raiting_info h5, #raiting_info img').toggle();
var req = $.ajax({
url: url,
type: "POST",
data: data_,
dataType: 'json',
});
req.done(function (msg) {
if (msg.error) {
$("#error_").text(msg.error);
$("#error_").show();
setTimeout($("#error_").hide, 3000);
} else {
star_widht = msg.new_raiting * 17;
$('#raiting_votes').width(star_widht);
}
});
错误跟踪
ca jquery.js:2
ca jquery.js:2
ca jquery.js:2
ca jquery.js:2
f.extend.param jquery.js:4
f.extend.ajax jquery.js:4
(anonymous function) vote.php:34
f.event.dispatch jquery.js:3
h.handle.i jquery.js:3
代码是真实的,数据对象的变量已正确初始化。