0

the problem is when i click on button to reload, it reloads successfully but soon after that my like buttons get disabled and i am unable to push like and and many more features get disable like they have just reset by itself.

  <div id="loadme">
 if (mysqli_num_rows($results) == 1) : ?>
                       <!-- user already likes post -->

                       <span class="unlike fa fa-heart inline-item" style="font-size:25px;" data-id="<?php echo $row['id']; ?>"></span>
                       <span class="like hide fa fa-heart-o inline-item" style="font-size:25px;" data-id="<?php echo $row['id']; ?>"></span>
                    <?php else : ?>
                       <!-- user has not yet liked post -->
                       <span class="like fa fa-heart-o inline-item" style="font-size:25px;" data-id="<?php echo $row['id']; ?>"></span>
                       <span class="unlike hide fa fa-heart inline-item" style="font-size:25px;" data-id="<?php echo $row['id']; ?>"></span>
                    <?php endif ?>
                    <span class="likes_count"><?php echo $row['likes']; ?> likes</span>
   </div>

Here is my script for reloading onclick

<script>

$(function() {
  $("#refresh").click(function(evt) {
     $('#loadme').load(location.href + ' #loadme');
     evt.preventDefault();
  })
})

  </script>

here #refresh is my button id

Sagar
  • 1
  • 2

0 Answers0