$(document).ready(function () {
setInterval(function() {
            
{% if submit_first %}
    var data = $("#form").serializeArray();
    $.post("{{ set_data_url }}", data);
{% endif %}

$.get( "{{ url }}", function(data) {
    
    if ("{{ followup }}" == "refresh") {
        move(direction="stay");
    } else if ("{{ followup }}" == "custom") {
        {{ custom_js }}
    } else if ("{{ followup }}" != "none") {
        move(direction="{{ followup }}");
    }
});
}, 
{{ interval }} * 1000)
});