1
I’m making an alert with jquery.... its function is to show the user the error and depending on the action lead to a following page... well already tested and the error is in jquery because when I put the alert in pure html it appears perfectly
this example above is with html... the way it should appear.
Let’s go to code
$(document).ready(function(e) {
var site = {
fechar: function(parametro){
$('#alerta-preto').fadeOut(2000);
$('#alerta-base').fadeOut(2000)
location.href="http://www.site.com.br/"+parametro+"";
}
alerta: function(conteudo,diretorio){
html = '';
html += '<div id="alerta-preto"></div>';
html += '<div id="alerta-base">';
html += '<div id="alerta-topo">Alerta <div id="alerta-fechar" onclick="site.fechar("'+diretorio+'")"></div></div>';
html += '<div id="alerta-branco">';
html += '<div class="titulo"><b>Ops,</b> Alerta</div>';
html += ''+conteudo+'';
html += '</div>';
html += '</div>';
$('#alerta-fly').append(html);
}
}
});
is +- so to call
//apenas para mostrar
site.alerta('Dados incorretos.','nao');
//para direcionar
site.alerta('Logado com sucesso.','inicio');
the problem is that it doesn’t work.... I checked that code every so often and it is well in my view...
Leandro is there any error message to show? Put so that we can help you.
– Hiago Souza
this alert is an error action of type : the user has erroneous the password ... here appears that box -- Incorrect data...
– Leandro Ferreira
Okay you run and it doesn’t look right?
– Hiago Souza
gives some error in console?
– Hiago Souza
I’ve already found some mistakes, I’m creating an answer
– Hiago Souza
blz.. I can check in the console why the server gave pal BY PURE KNOWLEDGE
– Leandro Ferreira