1$(document).ready(function () { 2 $("#acepto").prop('checked', false); 3 $("#acepto_checked").val(0); 4 $("#ID").val(''); 5 $("#passw").val(''); 6 $("#ID").keypress(function (e) { 7 if (e.which === 13) 8 validar_and_load_info(); 9 }); 10 $("#passw").keypress(function (e) { 11 if (e.which === 13) 12 validar_and_load_info(); 13 }); 14 $("#btn-login").click(function () { 15 validar_and_load_info(); 16 }); 17 $("#acepto").click(function () { 18 if ($("#acepto").is(':checked')) { 19 $("#acepto_checked").val(1); 20 } else { 21 $("#acepto_checked").val(0); 22 } 23 }); 24}); 25//Function that validates if the applicant exists and redirect to the resumen page 26function validar_and_load_info() { 27 var ID = $("#ID").val().trim(); 28 var passw = $("#passw").val().trim(); 29 var url_redirect = $("#url_redirect").val().trim(); 30 if (ID !== '' && passw !== '') { 31 if (!$("#acepto").is(':checked') || $("#acepto_checked").val() == 0) { 32 $("#error-msg").html("Aceptar los términos y condiciones de uso de la biblioteca virtual").show(); 33 return false; 34 } 35 $.ajax({url: '../models/controller.php', type: 'POST', data: {"task": 'log-in', "ID": ID, "passw": passw, "url_redirect": url_redirect}, 36 beforeSend: function () { 37 $("body").addClass("loading"); 38 }, success: function (data) { 39 var obj = $.parseJSON(data); 40 if (obj.success) { 41 if (url_redirect != '') { 42 //alert(url_redirect); 43 window.open(url_redirect, '_blank'); 44// window.location.href = url_redirect; 45// return false; 46 } 47 window.location.href = '../pages/menu.php'; 48 } else 49 $("#error-msg").html(obj.msg).show(); 50 $("body").removeClass("loading"); 51 }, error: function () {//si ha ocurrido un error 52 showMessage("<strong>Ha ocurrido un error cargando el nombre del programa</strong>"); 53 $("body").removeClass("loading"); 54 }}); 55 } else 56 $("#error-msg").html("Ingresa tu ID y Contraseña").show(); 57} 58//Function valida que el texto introducido es un número 59function validarSiNumero(numero) { 60 if (!/^([0-9])*$/.test(numero.trim())) 61 alert("Debe ingresar sólo números"); 62}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.