Send form without displaying the browser alert

0

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?

    
asked by anonymous 05.04.2018 / 16:26

1 answer

0

If someone has the same problem, I was able to resolve it by inserting the following code before the redirect:

window.onbeforeunload = null;
    
13.04.2018 / 17:28