1async function submitLead() { 2 const leadData = { 3 organizationName: document.getElementById('OrganizationName').value.trim(), 4 contactName: document.getElementById('ContactName').value.trim(), 5 contactPhoneNumber: document.getElementById('ContactPhoneNumber').value.trim(), 6 email: document.getElementById('Email').value.trim(), 7 isCalculator: document.getElementById('IsCalculator').value === 'True', 8 isElevator: document.getElementById('IsElevator').value === 'True', 9 isRegistration: document.getElementById('IsRegistration').value === 'True' 10 }; 11 try { 12 const response = await fetch('/Home/CreateLead', { 13 method: 'POST', 14 headers: { 15 'Content-Type': 'application/json', 16 }, 17 body: JSON.stringify(leadData) 18 }); 19 20 const data = await response.json(); 21 const successAlert = document.getElementById('leadModalSuccessAlert'); 22 const errorAlert = document.getElementById('leadModalErrorAlert'); 23 24 if (data.success) { 25 if (errorAlert) { 26 errorAlert.classList.add('d-none'); 27 } 28 if (successAlert) { 29 successAlert.classList.remove('d-none'); 30 } 31 32 if (leadData.isElevator || leadData.isRegistration) { 33 reachGoal('lead_customer'); 34 } 35 } else { 36 if (successAlert) { 37 successAlert.classList.add('d-none'); 38 } 39 if (errorAlert) { 40 errorAlert.innerText = data.errorDescription; 41 errorAlert.classList.remove('d-none'); 42 } 43 throw new Error(data.errorDescription); 44 } 45 } catch (error) { 46 console.error('ÐÑибка:', error); 47 throw error; 48 } 49}
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.