TCPA: By checking this box, I agree to the
    Terms and Conditions and Privacy Policy and authorize home services contractors, their agents, and marketing partners to contact me regarding home improvements and other non-insurance offers by telephone calls and text messages to the number I provided above. I agree to receive telemarketing calls and pre-recorded messages via an autodialed phone system, even if my telephone number or a mobile number is currently listed on any state, federal, or corporate "Do Not Call" list.
    I understand that my consent is not a condition of purchase of any goods or services and that I may revoke my consent at any time.

    Do Not Sell My Personal Information.


    document.getElementById("businessForm").addEventListener("submit", async function(e) { e.preventDefault(); const service = document.getElementById("service").value; const zip = document.getElementById("zip").value; try { const response = await fetch("/wp-json/myapi/v1/search-business", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ service, zip }) }); const data = await response.json(); if (data?.data?.length > 0) { const businessLink = data.data[0].servicePageURL || data.data[0].profileUrl; if (businessLink) { window.location.href = businessLink; } else { alert("Business found but no redirect link."); console.log("Response:", data); } } else { alert("No businesses found."); } } catch (error) { console.error(error); alert("Error connecting to API."); } });