SHOW:
|
|
- or go back to the newest paste.
1 | <script> | |
2 | function getLikes() { | |
3 | - | $.ajax({ |
3 | + | $.ajax({ |
4 | url: "get_like.php"; | |
5 | method: "post"; | |
6 | data: {"get" : "likes"}; | |
7 | dataType: "json"; | |
8 | success: function(data){ | |
9 | $(data).each(function(k, v) { | |
10 | $('[data-id='+v.post_id+']').find('span').text(v.likes); | |
11 | }); | |
12 | } | |
13 | - | }) |
13 | + | }); |
14 | } | |
15 | ||
16 | $(document).ready(function(){ | |
17 | setInterval(function (){ | |
18 | getLikes(); | |
19 | }, 1000); | |
20 | }); | |
21 | </script> |