1
How can I, if you have how, open a new page after returning a query on php
, what I have today is this here:
$(function () {
$("#frmConsulta").validate({
submitHandler: function (form) {
var data = $(form).serialize();
console.log(data);
$.ajax({
type: 'POST',
url: 'ajax/pRelatorioEvolucaoSafra.php',
data: data,
dataType: 'html',
success: function (response) {
// EXIBINDO O RETORNO DAS INFORMAÇÕES
$("#msgRelatorio").html(response);
$('#frmConsulta').each(function () {
this.reset();
});
},
error: function (xhr, ajaxOptions, thrownError) {
console.log(xhr, ajaxOptions, thrownError);
$("#msgRelatorio").html('<div class="alert alert-danger fade in"><button class="close" data-dismiss="alert">×</button><i class="fa-fw fa fa-times"></i><strong>ATENÇÃO!</strong> Ocorreu um erro ao tentar efetuar a consulta. Contate o suporte técnico.</div>');
}
});
return false;
}
});
});
In return I am positioned a table in the div msgRelatorio
, but I need to open it on a new page.
If you want to switch pages, why make an asynchronous request and not synchronous?
– Woss
Save the data in
LocalStorage
and then search them on another page via javascript. If this is a valid option I can post a reply.– DNick