here is my code for uploading some images on server
everything works except success - reloading the page after uploading is finished
I tried with another params - for example 20000 - without success
please help
inpfi.on('change', function(){
    var flist = inpfi[0].files;
    var fd = new FormData();
    for(let i = 0; i < flist.length; i++){fd.append('flist[]', flist[i]);}
    $.ajax({
        url: 'a_slike_up.php', 
        type: 'post',
        data: fd,
        dataType: 'json',
        contentType: false,
        processData: false,
        success: function(){setInterval('location.reload()', 7000);}
    })
});
update
I tried plain js and it works
So I need the same - but in my jquery code
function handler_finito(e){
    location.href = location.href;
}
inpfi.on('change', function(){
    // ...
    var ajax = new XMLHttpRequest();
    ajax.addEventListener("load", handler_finito, false);
    ajax.open("POST", "a_slike_up.php");
  ajax.send(fd);
});
 
    