like and dislike counter wordpress no plugin php and mysql

Solutions on MaxInterview for like and dislike counter wordpress no plugin php and mysql by the best coders in the world

showing results for - "like and dislike counter wordpress no plugin php and mysql"
Neele
26 Apr 2019
1<script>
2    $(document).ready(function() {
3        var pageID = <?php echo $pageID;  ?>;
4
5        $('.like-btn').click(function(){
6            $('.dislike-btn').removeClass('dislike-h');   
7            $(this).addClass('like-h');
8            $.ajax({
9                type:"POST",
10                url:"ajax.php",
11                data:'act=like&pageID='+pageID,
12                success: function(data){
13                    $('#cartop'+pageID).html(data);
14                }
15            });
16        });
17        $('.dislike-btn').click(function(){
18            $('.like-btn').removeClass('like-h');
19            $(this).addClass('dislike-h');
20            $.ajax({
21                type:"POST",
22                url:"ajax.php",
23                data:'act=dislike&pageID='+pageID,
24                success: function(data){
25                    $('#cartop'+pageID).html(data);
26                }
27            });
28        });
29        $('.share-btn').click(function(){
30            $('.share-cnt').toggle();
31        });
32    });
33</script>Copy