0

嗨,我正在尝试按照评级系统教程向我的网站添加评级系统,但 jquery 存在问题,并且希望有人能够突出显示错误,因为我对 jquery 还很陌生,无论如何任何帮助都会不胜感激,谢谢。

$('.star').click(function (){
var id = $(this).parent().attr('id').split('rating')[1];
var vote = $(this).index() 1;

$.ajax({
type: "POST",
url:"save-vote.php",
data: "id=" id "&vote=" vote
});

})

它表明该行存在错误:

var vote = $(this).index() 1;

谢谢

4

1 回答 1

0

There has to be something between index() and 1 The code you've posted is syntactically incorrect...

like

var vote = $(this).index() 1;

+ or - etc....

What do you want to do exactly....?

于 2012-08-11T09:08:18.367 回答