Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- function getLikes() {
- $.ajax({
- url: "get_like.php";
- method: "post";
- data: {"get" : "likes"};
- dataType: "json";
- success: function(data){
- $(data).each(function(k, v) {
- $('[data-id='+v.post_id+']').find('span').text(v.likes);
- });
- }
- });
- }
- $(document).ready(function(){
- setInterval(function (){
- getLikes();
- }, 1000);
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement