1$(document).ready(function(){ 2 var Url = window.location.href; 3 console.log(Url); 4}); 5 6$("#enviar_form").click(function (event) { 7 console.log("click"); 8 event.preventDefault(); 9 let mailFormat = 10 /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; 11 var numberFormat = /^[0-9]+$/; 12 var nombre = $("#nombre").val(); 13 var telefono = $("#telefono").val(); 14 var email = $("#correo").val(); 15 var mensaje = $("#mensaje").val(); 16 var acepto = $("#aceptar-politicas").is(":checked"); 17 18 19 if (nombre.length < 1) { 20 Swal.fire({ 21 icon: "error", 22 title: "UPS!", 23 text: 'El campo "nombre" es obligatorio', 24 }); 25 $("#nombre").focus(); 26 } else if (email.length < 1) { 27 Swal.fire({ 28 icon: "error", 29 title: "UPS!", 30 text: 'El campo "correo electrónico" es obligatorio', 31 }); 32 $("#correo").focus(); 33 } else if (!mailFormat.exec(email)) { 34 Swal.fire({ 35 icon: "error", 36 title: "ERROR", 37 text: "Ingresa una dirección de correo válida", 38 }); 39 } else if (telefono.length < 1) { 40 Swal.fire({ 41 icon: "error", 42 title: "UPS!", 43 text: 'El campo "teléfono" es obligatorio', 44 }); 45 $("#telefono").focus(); 46 } else if (!numberFormat.exec(telefono)) { 47 Swal.fire({ 48 icon: "error", 49 title: "ERROR", 50 text: "El campo solo acepta números", 51 }); 52 } else if (mensaje.length < 1) { 53 Swal.fire({ 54 icon: "error", 55 title: "UPS!", 56 text: 'El campo "mensaje" es obligatorio', 57 }); 58 $("#mensaje").focus(); 59 } else if (!acepto) { 60 Swal.fire({ 61 icon: "error", 62 title: "UPS!", 63 text: "Acepte las politicas de privacidad por favor", 64 }); 65 } else { 66 $.ajax({ 67 type: "POST", 68 url: "/web/mailer/mail.php", 69 data: $("#contact-form").serialize(), 70 success: function (res) { 71 console.log(res); 72 if (res.code == 200) { 73 Swal.fire({ 74 title: "Mensaje enviado con exito!", 75 text: "Pronto nos pondremos en contacto contigo!", 76 icon: "success", 77 }); 78 setTimeout(() => { 79 window.location.reload(); 80 }, 4000); 81 } else { 82 Swal.fire({ 83 title: "El mensaje no se ha enviado con exito!", 84 text: "Hubo un error. Inténtelo de nuevo más tardetarde.", 85 icon: "danger", 86 }); 87 } 88 }, 89 complete: function (res) { 90 console.log(res); 91 }, 92 }); 93 } 94});
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.