Здравствуйте. Возникла ошибка при отправки письма с формы, при чем на всех сайтах с этой формой. В чем дело ?
lead-stavcredit.com
function field_focus(e) {
$(e).addClass("edit_f_te"), e.value == $(e).attr("defval") && ($(e).hasClass("phone-code") ? e.value = "+" : e.value = "")
}
function field_blur(e) {
("" == e.value || "+" == e.value) && (e.value = $(e).attr("defval"), $(e).removeClass("edit_f_te"))
}
function _onfocus(e) {
field_focus(e)
}
function _onblur(e) {
field_blur(e)
}
function msg_end() {}
function pushmsg(e) {
var t = "p=1",
r = null,
n = "",
i = 0;
$(e).parents("form").each(function() {
r = this
});
var a = $(r).find("[sf='phone']");
$(a).attr("sname") || $(r).find("[sf='phone']").val($(r).find("[sname='Код страны']").val() + $(r).find("[sname='Код оператора']").val() + $(r).find("[sname='Номер']").val()), $(r).find("input[vemail*='true']").each(function() {
0 == validate($(this).val()) && ($(this).addClass("edit_f_error"), i = 1)
}), $("input").click(function() {
$(this).removeClass("edit_f_error")
}), $(r).find("input[vphone='true']").each(function() {
0 == validatephone($(this).val()) && ($(this).addClass("edit_f_error"), i = 1)
}), $(r).find("input[type='text'], textarea, select").each(function() {
t += $(this).hasClass("upfname") ? "&" + $(this).attr("id") + "=" + encodeURIComponent((null != $(this).attr("sname") ? $(this).attr("sname") : $(this).attr("defval")) + ":;:" + document.location + "uploads/" + $(this).val()) : "&" + $(this).attr("id") + "=" + encodeURIComponent((null != $(this).attr("sname") ? $(this).attr("sname") : $(this).attr("defval")) + ":;:" + $(this).val()), $(this).attr("defval") == $(this).val() && null != $(this).attr("require") && ($(this).addClass("edit_f_error"), i = 1)
}), $(r).find("input[type='radio']:checked, input[type='checkbox']:checked").each(function() {
t += "&" + $(this).attr("id") + "=" + encodeURIComponent((null != $(this).attr("sname") ? $(this).attr("sname") : $(this).attr("defval")) + ":;:" + $(this).val())
}), 1 != i && (referrer = "", self == top ? (referrer = document.referrer, null == referrer && (referrer = "")) : (referrer = parent.document.referrer, null == referrer && (referrer = "")), t += "&referrer=referrer: " + encodeURIComponent(referrer), t += "&url=url:;:" + encodeURIComponent(document.location), n = $(r).find(".label_to").text(), $(r).children().hide(), $(r).find(".progressimg").show(), t += "&" + generateGuid() + "=" + encodeURIComponent("Сайт:;: " + location.hostname), t += "&tmes=" + encodeURIComponent(n), console.log(t), $.ajax({
url: "ap_s/apushmsg.php",
data: t,
dataType: "jsonp",
success: function(e, t) {
"0" == e.error ? ($(r).find(".progressimg").hide(), $(r).find(".label_sndok").show(), $(r).find('a[goal="true"]').click(), putorder(), setTimeout(function() {
$(r).children("label, input").show(), $(r).children().show(), $(r).find(".label_sndok").hide(), $(r).find(".label_to").hide(), $(r).find(".progressimg").hide(), $(r).find("input[type='text']").each(function() {
$(this).val($(this).attr("defval")), $(this).attr("value", $(this).attr("defval"))
}), $("input").removeClass("edit_f_te")
}, 3e3)) : $(r).find(".label_sndok").show()
},
error: function(e, t, r) {
alert("Error!")
}
}))
}
function validate(e) {
var t = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
return 0 == t.test(e) ? !1 : !0
}
function validatephone(e) {
var t = /^\+?[+\-()\s\d]+$/;
return t.test(e)
}
function generateGuid() {
var e, t, r;
for (e = "", r = 0; 32 > r; r++)(8 == r || 12 == r || 16 == r || 20 == r) && (e += "-"), t = Math.floor(16 * Math.random()).toString(16).toUpperCase(), e += t;
return e
}
function bmf() {
$("form").each(function() {
$(this).find("input[type='text'], textarea").bind("focus", function() {
_onfocus(this)
}), $(this).find("input[type='text'], textarea").bind("blur", function() {
_onblur(this)
}), $(this).find("*").each(function() {
null == $(this).attr("id") && $(this).attr("id", generateGuid())
}), $(this).find("input[type='text'], textarea").each(function() {
null == $(this).attr("sname") && $(this).attr("sname", $(this).attr("defval"))
})
})
}
function init_forms() {
bmf()
}
function putvisit() {
var e = {};
e = {
site: location.hostname,
referrer: referrer,
reference: reference,
cookie: visiteduuid,
visit: 1,
order: 0
}, $.ajax({
url: "ap_s/index.php",
data: {
data: JSON.stringify(e)
},
dataType: "jsonp",
success: function(e, t) {},
error: function(e, t, r) {}
})
}
function putorder() {
var e = {};
e = {
site: location.hostname,
referrer: referrer,
reference: reference,
cookie: visiteduuid,
visit: 0,
order: 1
}, $.ajax({
url: "ap_s/index.php",
data: {
data: JSON.stringify(e)
},
dataType: "jsonp",
success: function(e, t) {},
error: function(e, t, r) {}
})
}
function getCookie(e) {
var t = new RegExp(e + "=([^;]+)"),
r = t.exec(document.cookie);
return null != r ? unescape(r[1]) : null
}
var visiteduuid = "-",
referrer = "-",
reference = "-";
$(function() {
setTimeout(function() {
try {
$.ajax({
url: "ap_s/v.php",
data: "ref=" + document.referrer,
dataType: "jsonp",
success: function(e, t) {
"0" == e.error
},
error: function(e, t, r) {}
})
} catch (e) {}
}, 1e3)
}), $(function() {
init_forms(), document.cookie.indexOf("visiteduuid") >= 0 ? visiteduuid = getCookie("visiteduuid") : (expiry = new Date, expiry.setTime(expiry.getTime() + 31104e6), visiteduuid = guid(), document.cookie = "visiteduuid=" + visiteduuid + "; expires=" + expiry.toGMTString()), referrer = "", self == top ? (referrer = document.referrer, null == referrer && (referrer = "")) : (referrer = parent.document.referrer, null == referrer && (referrer = "")), referrer = encodeURIComponent(referrer), reference = encodeURIComponent(document.location), putvisit()
});
var guid = function() {
function e() {
return Math.floor(65536 * (1 + Math.random())).toString(16).substring(1)
}
return function() {
return e() + e() + "-" + e() + "-" + e() + "-" + e() + "-" + e() + e() + e()
}
}();