// async function action(action, args = {}, debug = false) { // return await $.post(`main/action.php`, {action, args}); // } var event_id = JSON.parse(`3343`); var visitor = null; action('visit', {page: window.location.href, visitor, event_id}).then(res => visitor = res); setInterval(() => { action('visit', {page: window.location.href, visitor}); }, 5000);