Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- $(document).ready(function() {
- function updateDiv(){
- $.ajax({
- url: "test.json",
- dataType: "json",
- cache: false,
- success: function(data) {
- $.each(data, function(index, element) {
- $("#messages").html(element.message);
- }));
- });
- }
- });
- }
- updateDiv();
- setInterval(updateDiv, 5000);
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement