function initContactUsServices(baseurl) { var name = $("#name").val(); var email = $("#emailID").val(); var phone = $("#phoneNo").val(); var message = $("#message").val(); var xmlhttp1; try { xmlhttp1 = new XMLHttpRequest(); } catch (e) { try { xmlhttp1 = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp1 = new ActiveXObject("Microsoft.XMLHTTP") } catch (e) { alert("BROWSER BROKE"); return false; } } } xmlhttp1.open("POST", baseurl + "/wildcard/contactUs", true); xmlhttp1.setRequestHeader('Content-type', 'application/json;charset=UTF-8'); xmlhttp1.onreadystatechange = function () { if (this.status == 200 && this.responseText != null && this.responseText != "" && this.readyState == 4) { var res = JSON.parse(this.responseText); var loginRes = res.response; if (name != '' || email != '' || phone != '' || message != '') { $('#success_message').fadeIn().html(); setTimeout(function () { $('#success_message').fadeOut("slow"); }, 3000); } } }; xmlhttp1.send(JSON.stringify({ "url": window.location.protocol + "//" + window.location.host, "name": name, "emailID": email, "phoneNo": phone, "message": message, "roles": [] })); } function initRequestAQuoteServices(baseurl) { var fname = $("#fullName").val(); var mail = $("#emailID").val(); var phoneNo = $("#phoneNo").val(); var location = $("#projectLocation").val(); var selectedService = $("#serviceRequired").val(); var source = $("#source").val(); var details = $("#details").val(); var xmlhttp1; try { xmlhttp1 = new XMLHttpRequest(); } catch (e) { try { xmlhttp1 = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp1 = new ActiveXObject("Microsoft.XMLHTTP") } catch (e) { alert("BROWSER BROKE"); return false; } } } xmlhttp1.open("POST", baseurl + "/wildcard/requestAQuote", true); xmlhttp1.setRequestHeader('Content-type', 'application/json;charset=UTF-8'); xmlhttp1.onreadystatechange = function () { if (this.status == 200 && this.responseText != null && this.responseText != "" && this.readyState == 4) { var res = JSON.parse(this.responseText); var loginRes = res.response; console.log(loginRes); if (fname != '' && mail != '' && phoneNo != '' && location != '' && selectedService != '' || source != '' || details != '') { $('#sent_message').fadeIn().html(); setTimeout(function () { $('#sent_message').fadeOut("slow"); }, 3000); } } }; xmlhttp1.send(JSON.stringify({ "url": window.location.protocol + "//" + window.location.host, "fullName": fname, "emailID": mail, "phoneNo": phoneNo, "projectLocation": location, "serviceRequired": selectedService, "source": source, "details": details, "roles": [] })); }