I am submitting a form with JS and after doing everything right, I redirect the page as follows:
window.location.href = '/admin/lojas/produtos';
The problem is that the alert always appears below and the user has to click on "leave the page" to complete the redirect .
I know that it is normal for this alert to appear when doing the submit of the form for POST , but would have some way to change the way I am doing the redirect to circumvent this warning?