Advertisement
Guest User

Polling

a guest
Dec 12th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.29 KB | None | 0 0
  1. (function poll() {
  2.     setTimeout(function () {
  3.         $.ajax({
  4.             url: 'path/to/resource',
  5.             dataType: 'json',
  6.             complete: poll,
  7.             success: function (data) {
  8.                 // dolgozd fel a data-t
  9.             }
  10.         })
  11.     }, 500);
  12. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement