$(document).ready(function ($) { var go = true; var globalParameters; window.setTimeout(function () { $("input[name=email]").closest("form").submit(function (t) { go = true; var e = $(this), n = "", i = !0, s = self.location, r = new URL(s), a = r.searchParams.get("utm_campaign"), o = r.searchParams.get("utm_medium"), l = r.searchParams.get("utm_source"); $(this).append(''); $(this).append(''); $(this).append(''); e.serializeArray().forEach(function (t) { if (t.value == '') { go = false; $("#" + t.name).focus(); $("#" + t.name).addClass("bg-danger"); } }); if (go) { var lthis = $(this); $.ajax({ url: $(this).attr("action"), data: e.serializeArray(), cache: !1, async: !1, type: "POST", success: function (a) { if (null !== lthis.data("action")) { n = lthis.data("action"); if (typeof replaceURLLink === 'function') { n = replaceURLLink(n); } var regexp = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/ if (!regexp.test(n)) { n = window.location.protocol + '//' + String(window.location.hostname + window.location.pathname + '/../' + n).replace('//', '/'); } self.location = n; } else { alert("Obrigado!"); } } }); } return false; }); }, 100); });