Preview:
(function refreshPendingIncidents() {
  $.ajax({
    url: '/pending-incidents/refresh/' + "{{ $reports[0]->id }}",
    success: function(data) {
      console.log(data)
      console.log('test')
    },
    complete: function() {
      // Schedule the next request when the current one's complete
      setTimeout(refreshPendingIncidents, 3000);
    }
  });
})();
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter