我希望能够显示一条消息,如果用户没有登录,如果他们尝试通过点击评级对用户进行评级。有没有办法将它添加到我的JQuery代码下面,或者我可以将它传递给我的PHP脚本?有没有办法检查用户是否使用JQuery登录?
我正在使用PHP
这是JQuery代码。
$('#rate li a').click(function(){
$.ajax({
type: "GET",
url: "http://localhost/update.php",
data: "rating="+$(this).text()+"&do=rate",
cache: false,
async: false,
success: function(result) {
// remove #ratelinks element to prevent another rate
$("#rate").remove();
// get rating after click
getRating();
getRatingAvg();
getRatingText2();
getRatingText();
},
error: function(result) {
alert("some error occured, please try again later");
}
});
送东西从那里回来?请原谅我的无知。 – jphp 2010-08-05 08:00:51
请参阅Reigels的答案。他提供了一个更完整的答案。 – ZeissS 2010-08-05 09:57:22