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