I'm making an alert with jquery .... the function of it is to show the user the error and depending on the action lead to a next page ... well I already tested it and the error is in jquery because when I put the alert in pure html it appears perfectly
Thisexampleabovehashtml...thewayitshouldappear.
Let'sgotothecode
$(document).ready(function(e){varsite={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);
}
}
});
+ - so to call
//apenas para mostrar
site.alerta('Dados incorretos.','nao');
//para direcionar
site.alerta('Logado com sucesso.','inicio');
The problem is that it does not work .... I checked this code several times and it's fine to see ...