Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <button type = "button" id = "liker" class = "like"><i id = "icon" class="fa fa-heart-o fa-lg"></i></button><p class = "disp"></p>
- <script type="text/javascript">
- $(document).ready(function(){
- $(".like").click(function(){
- $.ajax({
- type: "POST",
- url: "favorites_updateDB2-Ashwin.php",
- data: {favorite : '.$fileid.'},
- success: function(data) {
- $("p.disp").text(data);
- $("#liker").attr("class","unlike");
- $("#icon").attr("class","fa fa-heart fa-lg");
- }
- });
- });
- $(".unlike").click(function(){
- $.ajax({
- type: "POST",
- url: "favorites_updateDB2-Ashwin.php",
- data: {favorite : '.$fileid.'},
- success: function(data) {
- $("p.disp").text(data);
- $("#liker").attr("class","like");
- $("#icon").attr("class","fa fa-heart-o fa-lg");
- }
- });
- });
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement