3
I have an ajax request responsible for sending a file to Servlet, it is performing the process correctly. But when I update the page the following message is displayed by the browser (When I give a F5):
The page you are looking for used inserted information. Going back to this page can cause all actions performed to be rethought. Wishes to Continue ?
I don’t want this message to appear to my users.
Ajax request:
$(document).ready(function($) {
$("#formAv").submit(function(event) {
var dados = new FormData(this);
var url = "Avatar";
$.ajax({
url: url,
type: 'GET',
data: dados,
mimeType: "multipart/form-data",
contentType: false,
cache: false,
processData: false,
});
});
});
NOTE: The message is from the browser itself, I tried to clear the form after sending but did not resolve.
If you’re doing Ubmit via ajax you should have
event.preventDefault();
within that function, beforevar dados
for example.– Sergio
Thanks for the answer worked! Just remembering that the type is POST, I was wrong to paste the code.
– Diogo Ferreira