1$(document).ready(() => { 2 $("#register-form-razao-social").keyup((e) => { 3 const input = e.target.value; 4 5 if (input.length >= 3) { 6 fetch("/include/company_searching", { 7 method: 'POST', 8 body: JSON.stringify({input}) 9 }) 10 .then(res => res.json()) 11 .then(data => { 12 $("#register-form-razao-social").autocomplete({ 13 source: data, 14 select: function (event, ui) { 15 if (ui.item.cnpj != null) { 16 $("#register-form-cnpj").val(ui.item.cnpj).focusout() 17 18 if (ui.item.fantasia != null) { 19 $("#register-form-nome-fantasia").prop('readonly', true).val(ui.item.fantasia).focusout(); 20 }else{ 21 $('#register-form-nome-fantasia').removeAttr('readonly'); 22 } 23 } 24 } 25 }); 26 } 27 ) 28 .catch(error => console.log(error)) 29 } else { 30 $("#register-form-razao-social").autocomplete({ 31 source: [] 32 }); 33 } 34 }) 35})
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.