Código:
function iniciarLogin()
{
var n=$("#nick").attr("value");
var p=$("#pass").attr("value");
var paramentros = {"nick":n, "pass": p};
$.ajax({
async:true,
type: "POST",
dataType: "html",
contentType: "application/x-www-form-urlencoded",
url:"autentificar.php",
data: paramentros,
beforeSend:inicioEnvio,
success:llegadaDatos,
timeout:1000,
error:problemas
});
return false;
}
function inicioEnvio()
{
var x=$("#resultados");
x.html('<img src="imagenes/cargando.gif">');
}
function llegadaDatos(datos)
{
if (datos == "si")
{
location.reload();
}
else {if (datos == datos){
$("#resultados").text(datos);
}else {
document.formulario.submit();
}
}
}
function problemas()
{
$("#resultados").text('Problemas en el servidor.');
}



