0

我有一个脚本帽子在ajax之后加载所有数据,在那个响应数据上likeObj('#like'+postid).effect("bounce", {times:1,distance:25},400);

这将给出 likeObj 不是函数的错误。

我该怎么办,帮帮我。

谢谢

 if(response=='OK')
                            {
                                    if(likeval==1)
                                    {
                                        var commentCount=likeobj("#firstPost"+postid+'1').text();
                                        //var newcount=+commentCount + +1;
                                        var  newcount=parseInt(commentCount) + parseInt(1);
                                        //likeobj('#like'+postid).effect("bounce", {times:1,distance:25},400);                                          
                                        likeobj("#firstPost"+postid+'1').html("<img alt='Image' src='images/like_icon.gif'> "+newcount);
                                        likeobj("#ullikesuser_"+user_id+"_"+postid).fadeIn(300, function() { likeobj("#ullikesuser_"+user_id+"_"+postid).append(likeobj("<li><?=getUserProfileImage($_SESSION['user_id'])?></li>").attr('id','lilikesuser_'+user_id+'_'+postid)); });
                                        //likeobj("#ullikesuser_"+user_id+"_"+postid).append(likeobj("<li><?=getUserProfileImage($_SESSION['user_id'])?></li>").attr('id','lilikesuser_'+user_id+'_'+postid));
                                        likeobj("#like"+postid).html(showhtml);
                                    }else{
                                        var commentCount=likeobj("#firstPost"+postid+'1').text();
                                        var  newcount=parseInt(commentCount) - parseInt(1); 
                                        //likeobj('#like'+postid).effect("bounce", {times:1,distance:25},400);
                                        likeobj("#firstPost"+postid+'1').html("<img alt='Image' src='images/like_icon.gif'> "+newcount);
                                        //$(this).fadeOut(500, function() { $(this).remove(); });
                                        likeobj("#lilikesuser_"+user_id+"_"+postid).fadeOut(200, function() { likeobj("#lilikesuser_"+user_id+"_"+postid).remove(); });
                                        likeobj("#like"+postid).html(showhtml);
                                        //likeobj("#like"+postid).html(response);
                                    }
                            }

.

从ajax得到响应后

4

1 回答 1

0

看起来您的代码中没有包含 jQuery ui 文件。添加 jQuery UI 并尝试。

<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
于 2013-04-08T11:32:57.500 回答